OPEN-SOURCE SCRIPT

Cicli DAX Multi-Timeframe

//version=5
indicator("Cicli DAX Multi-Timeframe", overlay=false)

// Input per la durata dei cicli
cycleWeekly = input(5, title="Durata Ciclo Settimanale")
cycleMonthly = input(20, title="Durata Ciclo Mensile")
cycleQuarterly = input(60, title="Durata Ciclo Trimestrale")
cycleSixMonths = input(120, title="Durata Ciclo Semestrale")
cycleAnnual = input(240, title="Durata Ciclo Annuale")
cycleBiennial = input(480, title="Durata Ciclo Biennale")

// Funzione per calcolare il ciclo
calcCycle(period) =>
ta.sma(close, period)

// Calcolo dei cicli
weeklyCycle = calcCycle(cycleWeekly)
monthlyCycle = calcCycle(cycleMonthly)
quarterlyCycle = calcCycle(cycleQuarterly)
sixMonthCycle = calcCycle(cycleSixMonths)
annualCycle = calcCycle(cycleAnnual)
biennialCycle = calcCycle(cycleBiennial)

// Traccia i cicli
plot(weeklyCycle, color=color.blue, title="Ciclo Settimanale", linewidth=1)
plot(monthlyCycle, color=color.green, title="Ciclo Mensile", linewidth=1)
plot(quarterlyCycle, color=color.red, title="Ciclo Trimestrale", linewidth=1)
plot(sixMonthCycle, color=color.orange, title="Ciclo Semestrale", linewidth=1)
plot(annualCycle, color=color.purple, title="Ciclo Annuale", linewidth=1)
plot(biennialCycle, color=color.yellow, title="Ciclo Biennale", linewidth=1)
Bill Williams IndicatorsBreadth IndicatorsCycles

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