noomnahor

altcoin index oscillator

Use
Compare alt coins to the "altcoin index", an average of a selection of alt coins.
Above zero means the coin you are viewing is worth more than the index, indicating the possibility of overbought.
Below zero indicating the opposite, a possibility of oversold.
Press the cog icon to select which alt coins you want included in the index.

Notes
The coins in the index are ALTBTC, meaning their value against BTC. Due to this the indicator is useless when viewing BTC only charts.
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?
//@version=2
//study("altcoin averages")
study("altcoin index oscillator", overlay=false)

curr = security(tickerid, period, ohlc4)

ch1 = input(true, "include ppcbtc", bool)
ch2 = input(false, "include ethbtc", bool)
ch3 = input(true, "include nmcbtc", bool)
ch4 = input(true, "include nxtbtc", bool)
ch5 = input(true, "include xmrbtc", bool)

count = ch1 + ch2 + ch3 + ch4 + ch5

ppc = iff(ch1, security("THEROCKTRADING:PPCBTC", period, ohlc4), 0)
eth = iff(ch2, security("KRAKEN:ETHXBT", period, ohlc4), 0)
nmc = iff(ch3, security("THEROCKTRADING:NMCBTC", period, ohlc4), 0)
nxt = iff(ch4, security("HITBTC:NXTBTC", period, ohlc4), 0)
xmr = iff(ch5, security("HITBTC:XMRBTC", period, ohlc4), 0)

average = avg(ppc, eth, nmc, nxt, xmr)
diff = (curr - average) / (average)
max = highest(diff, 21)
min = lowest(diff, 21)
highestAbs = abs(max) > abs(min) ? abs(max) : abs(min)
osc = diff / highestAbs

over = diff > 0
under = diff < 0

colordef = over ? red : under ? green : white

plot(osc, "osc", color=colordef, style=line)

plot(1, title = "Top Line", color = white, linewidth = 1)
plot(0, title = "Zero Line", color = yellow, linewidth = 1)
plot(-1, title = "Bottom Line", color = white, linewidth = 1)