OPEN-SOURCE SCRIPT

200W SMA Annual CAGR Tracker

168
A Pine Script indicator that calculates the annualized Compound Annual Growth Rate (CAGR) for either the weekly close price or the weekly 200-period Simple Moving Average (200W SMA). The script allows users to choose a custom lookback period expressed in years, months, or weeks, and it displays both the reference series and the computed CAGR as a chart label and an optional summary table.

Features:

Weekly reference series plotting:
200W SMA
Weekly close
Annual CAGR calculation over configurable lookback periods
Custom lookback unit: years, months, or weeks
Optional on-chart label with CAGR value
Optional table summary showing current value, past value, CAGR, and lookback duration
Use Case:
Ideal for long-term traders and investors who want a quick visual gauge of how the weekly trend or 200-week moving average has performed on an annualized basis. Great for comparing price momentum against a slow-moving trend benchmark.

How to Use:

Select the reference type: 200W or Weekly
Choose the lookback length and unit
Enable labels and/or the table for a cleaner visual summary
Apply to weekly or lower timeframes to view the weekly reference and CAGR overlay
Note:
This indicator uses historical weekly data with lookahead=barmerge.lookahead_off to avoid repainting.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.