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.
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
//@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)