Diupdate

Add 40 Moving Averages From Any Time Frame [CandleChasers]

400
Add 40 Moving Averages From Any Time Frame [CandleChasers]

One workspace for comparing up to 40 moving averages with independent types, lengths, and timeframes. The purpose is flexible comparison and clear identification without stacking many separate indicator instances.

Each numbered slot has its own enable switch, average type, length from 1 to 2000, and timeframe. Per-line color and thickness are adjustable under Settings → Style. A shared source selector offers Close, Open, High, Low, HL2, HLC3, or OHLC4, evaluated in each calculation timeframe.

SUPPORTED TYPES

• EMA: exponential moving average.
• SMA: simple moving average.
• WMA: linearly weighted moving average.
• RMA / SMMA: Wilder-style smoothing, implemented using Pine RMA.
• HMA: Hull moving average.
• VWMA: volume-weighted moving average, not VWAP.
• DEMA: twice the first EMA minus its second EMA stage.
• TEMA: three times the first EMA minus three times the second stage plus the third stage.

SMMA is used here as a name for the RMA implementation; initialization conventions may differ across platforms. VWMA needs usable feed volume. HMA length 1 returns the selected source directly. No average is presented as universally superior.

TIMEFRAMES AND CONFIRMATION

Blank timeframe means chart timeframe. Equal-duration selections also use chart calculation. Length is measured in the selected timeframe's candles: a 20-period daily MA uses daily bars, not 20 chart bars.

Chart-timeframe averages update during the open chart candle. Higher-timeframe lines use the previous completed source candle's average and carry it into the next source period. They are deliberately stepwise and do not track the unfinished source candle. History offsets with lookahead_on prevent future final HTF values from being leaked into earlier chart bars.

All 40 enabled slots may use supported higher timeframes, within a conservative 40-slot request budget. Lower timeframes are not supported and produce an explanatory error naming the slot. Changing the chart timeframe can make a previously valid selection a lower timeframe; review enabled slots if this occurs.

LABELS AND LEGEND

Right-edge labels show slot number, type, length, and timeframe, with HTF identifying higher-timeframe values. Hover for the snapshot value and calculation mode. Label size and horizontal offset are adjustable.

Labels match the built-in line palette by default. Pine cannot read manual Style-tab color overrides, so those overrides cannot automatically recolor the labels. Keep default line colors for matching, or select a neutral label color. Slot numbers distinguish lines where palette colors repeat.

An optional legend lists enabled slots, types, lengths, timeframes, and values. It defaults off and offers three text sizes. Input values are hidden from the status line to preserve chart space.

DISPLAY REFRESH AND PERFORMANCE

The script calculates the selected average family, skips disabled slots, confines extra EMA stages to DEMA/TEMA, and reuses label objects. It uses 40 ordinary line plots rather than rebuilding short drawing fragments.

Labels and the legend refresh at chart-bar close by default while chart-timeframe lines continue updating live. Displays initialize on the last confirmed history candle. On an open candle, label positions/values may therefore lag the developing line. Disable the bar-close display option for realtime labels and legend values.

More enabled lines, HTF requests, long lengths, and large datasets can increase load. Disable unused slots under Inputs; hiding a plot under Style does not disable its calculation. Many similar labels can overlap, and a large legend can be tall. No specific runtime or speed improvement is guaranteed.

GETTING STARTED

Four chart EMAs default on: 9, 21, 50, and 200. The other 36 slots default off. These are example starting settings, not optimized trading parameters.

1. Add the indicator to a standard time-based candlestick chart.
2. Enable only the MA slots needed.
3. Choose each type, length, and chart/higher timeframe.
4. Adjust appearance under Style.
5. Use the labels or optional legend to identify the lines.

PURPOSE AND LIMITATIONS

The formulas are established methods. This implementation combines independent configuration, completed HTF handling, bounded plot/request usage, persistent identification labels, and configurable display refresh for a single comparison workflow. More averages do not inherently improve trading decisions.

Long lengths and multiple smoothing stages require sufficient source history. Missing volume can make VWMA unavailable. Feed revisions, loaded chart history, and input changes can alter recalculated results.

This is a visual analysis indicator. It places no orders and provides no crossover signals, alerts, strategy backtest, verified win rate, or claimed trading edge.
Catatan Rilis
Fixed an error when displaying lower timeframe moving averages.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.