Diabolicus

Exchange Comparison [Diabolicus]

309 1 31
This script helps you compare bitcoin prices across different currency pairs and exchanges. Quickly judge at a glance if "your" exhange currently trades above or below the rest of the market.
Each colored line represents an exchange pair of your choice. Exchange pairs must be entered normalized to USD, so for BTCEUR             or XBTEUR multiply by EURUSD             , for BTCCNY             divide by USDCNH             respectively.
Remove from Favorite Scripts Add to Favorite Scripts
study("Exchange Comparison [Diabolicus]", shorttitle="ExComp_Dia", overlay=true)

// 141113
// Exchange pairs must be normalized to USD, so multiply by EURUSD or divide by USDCNH respectively

pair1 = input(defval="BITFINEX:BTCUSD",title="Exchange Pair 1 Yellow")
pair2 = input(defval="BTCE:BTCUSD",title="Exchange Pair 2 Green")
pair3 = input(defval="BITSTAMP:BTCUSD",title="Exchange Pair 3 Orange")
pair4 = input(defval="KRAKEN:XBTEUR*EURUSD",title="Exchange Pair 4 Blue")
pair5 = input(defval="HUOBI:BTCCNY/USDCNH",title="Exchange Pair 5 Red")
pair6 = input(defval="OKCOIN:BTCCNY/USDCNH",title="Exchange Pair 6 Lime")

sym_hl2(s)=>security(s,period,hl2)
eurusd = sym_hl2("FX:EURUSD")
usdcnh = sym_hl2("FX:USDCNH")

base = ticker == "XBTEUR" ? 2 : ticker == "BTCEUR" ? 2 : ticker == "BTCCNY" ? 3 : 1

factor = base==2 ? 1/eurusd : base==3 ? usdcnh : 1

p1=plot(sym_hl2(pair1)*factor,color=yellow,linewidth=2)
p2=plot(sym_hl2(pair2)*factor,color=green,linewidth=2)
p3=plot(sym_hl2(pair3)*factor,color=orange,linewidth=2)
p4=plot(sym_hl2(pair4)*factor,color=blue,linewidth=2)
p5=plot(sym_hl2(pair5)*factor,color=red,linewidth=2)
p6=plot(sym_hl2(pair6)*factor,color=lime,linewidth=2)
nice one
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder 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