Quicksilver80

Arbitrage

179 4 14
Arbitrage v1.0
This is a simple tool to indicate arbitrage opportunities between TWO markets. Base currency must be the same for both markets. Arbitrage signal and minimum market spread uses percentage, base currency or both. Spread input accepts increments as small as 0.00000001. Works best with smaller time frames.

I will develop this further if enough people show an interest.
Remove from Favorite Scripts Add to Favorite Scripts
 
// This is a simple tool to indicate arbitrage opportunities between two markets. 
// Base currency must be the same for both markets. 
// Arbitrage signal and minimum market spread uses percentage, base currency or both. 
// Spread input accepts increments as small as 0.00000001. Works best with smaller time frames.

study(title="Arbitrage", shorttitle="Arb1.0", overlay=false)
spread = input(10,step=0.00000001,title="Spread $")
spreadpct = input(5,step=0.00000001,title="Spread %")/100
sym1 = input("BTCUSDT",title= "Symbol 1")
sym2 = input("COINBASE:BTCUSD",title= "Symbol 2")
source = close
sym11 = sym1, res11 = period
sym22 = sym2, res22 = period 

s1 = security(sym11, res11, source)
s2 = security(sym22, res22, source)

sym33 = s2-s1
aaa=(s2/s1)-1
bbb = aaa*100
plot(sym33, color=sym33>0?green:red, linewidth=2,style = columns,title="$",transp=60)
plot(bbb, color=bbb>0?teal:orange, linewidth=2,style = columns,title="%",transp=100)

bgcolor(abs(sym33)>=spread?purple : na, transp=40,title = "Spread $")
bgcolor(aaa>=spreadpct?yellow : na, transp=100,title = "Spread %",transp=100)







gianfranco60
9 months ago
Hi this indicator maybe useful between usoil /ukoil but it is not perfect yet. Thanks
Reply
Quicksilver80
9 months ago
// This is an update to Arbitrage.
// Base currency must be the same for both markets.
// Arbitrage signal and minimum market spread uses percentage or base currency.
// Spread input accepts increments as small as 0.00000001 to support cryptocurrencies.
// Default Spread Values: 2.5% and 0.00025000 base currency points.

study(title= "Arbitrage", shorttitle= "Arb2.0", overlay= false)
source = close
spread = input(0.00025000, step=0.00000001, title= "Spread")
zzz = input(true, title= "Calculate Spread By % ?")
spreadp = input(2.50000000,step= 0.00000001, title= "Spread %")
spreadpct = spreadp/100
m1 = input("POLONIEX:BTCUSDT" ,title= "Market 1")
m2 = input("COINBASE:BTCUSD", title= "Market 2")
res1 = period
res2 = period
s1 = security(m1, res1, source)
s2 = security(m2, res2, source)
aaa = s2-s1
bbb = (s2/s1)-1
ccc = bbb*100
buy = min(s1,s2)
sell = max(s1,s2)
x1 = (sell/buy)-1
plot(zzz==0? aaa :na, color= aaa>0 ? green : red, style = columns, title= "$", transp= 60)
plot(zzz==1? bbb : na, color= ccc>0 ? green : red, style = columns, title= "%", transp= 60)
bgcolor(zzz==1? na : abs(aaa) >= spread? fuchsia : na, transp=80, title= "$ Signal")
bgcolor(zzz==0? na : x1 >= spreadpct? fuchsia : na, transp=80, title= "% Signal")
plot(zzz==0? spread : spreadpct, color= aqua, style= line, title= "Buy M1", transp= 20, linewidth= 1)
plot(zzz==0? spread*-1 : spreadpct*-1, color= orange, style= line, title= "Sell M1", transp= 10, linewidth= 1)
+2 Reply
DeemaKzk Quicksilver80
2 months ago
@Quicksilver80, It`s that what i was look for Big Respect.

but how to update it ? I need 2 create new indi. and copy/paste this code ?
Reply
DeemaKzk DeemaKzk
2 months ago
Done ... Thx!
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out