# Arbitrage Sniper (POC)

Today I want to share with you the proof-of-concept of how you would be able to do arbitrage with crypto pairs.
THE INDICATOR MUST BE PLACED ON THE TRADING PAIR OF THE TWO CURRENCIES (i.e. ETH/BTC , EOS /ETH etc.)

This arbitrage method is based on the transitional decorrelation between the crypto treding pair and the price ratio of the involved currencies, of course computing commissions as well.
Whenever the non-arbitrage condition is not respected, there is an arbitrage oportunity.
This indicator won't consider the chance of shorting, so if the arbitrage oportunity occurs the indicator will suggest you just the chance of buying the relative-undervalued currency (but inside the code you will know how to do the alternative method as well, by shorting the relative-overvalued currency)

Let's take the trading pair ETH/BTC (as in the graph) → if we assume commissions for the 0.075% of the order, the non-arbitrage condition will be presented like this
This arbitrage method will need three orders, so n=3

So let's assume that P(ETH)/(P( BTC )*P( ETH/BTC ))>(1-0.075)^(-3) → it means that the price of Ethereum is currently overreated enough (relatively to the trading pair) for doing arbitrage.

We have two alternatives:
• Buy BTC , change it into ETH (by "buying" ETH in the trading pair ETH/BTC ) and then sell ETH
• Sell ETH, buy BTC , change it into ETH (by "buying" ETH in the trading pair ETH/BTC )

On the other hand, if P(ETH)/(P( BTC )*P( ETH/BTC ))<(1-0.075)^(-3) → it means that the price of Ethereum is currently underrared enough (relatively to the trading pair) for doing arbitrage.

We have two alternatives:
• Buy ETH, change it into BTC (by "selling" ETH in the trading pair ETH/BTC ) and then sell BTC
• Sell BTC , buy ETH, change it into BTC (by "selling" ETH in the trading pair ETH/BTC )

I'm saying that is nothing more than a proof-of-concept since:
- Arbitrage Oportunities will emerge frequently just nearly zero commissions
- Data of prices are retrieved using security() function and there can be some delay (so the arbitrage oportunity will be already extinguished by the time the signal is retrieved)
- In order to have the freshest data, repiainting will occurr
Informacje o Wersji: Small update in order to make it prevent-repainting compliant according to the recent changes made by script moderators

Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?