OPEN-SOURCE SCRIPT

Altcoin Cycle Indicator

//version=5
indicator("Altcoin Cycle Indicator", overlay=true)

// Entrada: Dominância do Bitcoin
btc_dominance = request.security("CRYPTOCAP:BTC.D", "D", close)

// Configuração dos Limiares
altseason_threshold = input(40, "Altseason Threshold (%)") // Limite abaixo do qual começa a Altseason
btc_season_threshold = input(60, "Bitcoin Season Threshold (%)") // Limite acima do qual é domínio do BTC

// Lógica do Ciclo
is_altseason = btc_dominance < altseason_threshold
is_btcseason = btc_dominance > btc_season_threshold

// Marcando o Gráfico
bgcolor(is_altseason ? color.new(color.green, 85) : na, title="Altseason Zone") // Fundo verde para Altseason
bgcolor(is_btcseason ? color.new(color.red, 85) : na, title="Bitcoin Season Zone") // Fundo vermelho para BTC Season

// Alertas
alertcondition(is_altseason, title="Altseason Started", message="Altseason has likely started!")
alertcondition(is_btcseason, title="Bitcoin Season Started", message="Bitcoin season is dominating!")

// Exibir os valores no gráfico
plot(btc_dominance, color=color.blue, title="BTC Dominance")
hline(altseason_threshold, "Altseason Threshold", color=color.green)
hline(btc_season_threshold, "Bitcoin Season Threshold", color=color.red)

Cycles

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer