OPEN-SOURCE SCRIPT
Atualizado Moving Average XL

Moving Average XL is a customizable multi-moving-average overlay that allows traders to plot up to three separate moving averages on the chart at the same time. Each moving average can be independently enabled, adjusted, styled, and color-coded, making it useful for trend direction, dynamic support and resistance, crossover analysis, and multi-timeframe-style trend context.
Each MA group includes the same core settings. “Show MA” turns that moving average on or off. “Length” controls the number of candles used in the calculation, with shorter lengths reacting faster to price and longer lengths smoothing price action more heavily. “Type” lets the user choose between SMA, EMA, WMA, VWMA, RMA, and HMA depending on how responsive or smooth they want the line to be. “Line Style” changes the visual display between solid, stepline, or circles. “Line Thickness” controls the weight of the plotted line, and “Color” lets the user customize each average for easier chart reading.
This indicator is designed for traders who want a clean, flexible moving average tool without unnecessary clutter. Use shorter averages to track near-term momentum, medium averages to define intermediate trend direction, and longer averages to identify major trend bias or high-probability support and resistance areas.
Each MA group includes the same core settings. “Show MA” turns that moving average on or off. “Length” controls the number of candles used in the calculation, with shorter lengths reacting faster to price and longer lengths smoothing price action more heavily. “Type” lets the user choose between SMA, EMA, WMA, VWMA, RMA, and HMA depending on how responsive or smooth they want the line to be. “Line Style” changes the visual display between solid, stepline, or circles. “Line Thickness” controls the weight of the plotted line, and “Color” lets the user customize each average for easier chart reading.
This indicator is designed for traders who want a clean, flexible moving average tool without unnecessary clutter. Use shorter averages to track near-term momentum, medium averages to define intermediate trend direction, and longer averages to identify major trend bias or high-probability support and resistance areas.
Notas de Lançamento
Pine v6 update.Minor internal default updates for improved user experience.
Notas de Lançamento
**Moving Average XL — Full Description**An overlay indicator that plots three fully independent moving averages and can extend each one into the future as a slope-based projection, with an optional non-repaint mode.
**The three moving averages (unchanged from the original)**
- Three separate averages, each controlled on its own with no shared settings.
- For every average you can set: whether it displays, its length, its calculation type, its on-chart line style, its thickness, and its color.
- Calculation types available: SMA, EMA, WMA, VWMA, RMA, and HMA — so each average can react at a different speed or weighting.
- Line styles available: Solid, Stepline, and Circles.
- All three are calculated from closing price. Defaults are a 20, a 50, and a 200, in blue, red, and black, mirroring a common short/medium/long setup.
**Projections (new)**
- Any average can throw a straight line forward from its current point, tilted at the average slope of its recent movement. In plain terms, it continues the line at the pace it has lately been traveling.
- The tilt is measured over a lookback window you choose, then held constant and drawn out to a distance you choose. A steeper recent move produces a steeper projection.
- The projection is drawn only from the most recent point and refreshes cleanly rather than leaving a trail behind it.
- Each average's projection is fully independent, with its own set of controls, so a fast average and a slow one can each project differently.
- Projection line styles available: Solid, Dashed, and Dotted, with Dashed as the default so the forward line reads as speculative rather than as real, plotted data.
- Forward distance can reach up to 500 bars, the platform's ceiling for this kind of drawing.
**Non-Repaint mode (new)**
- A single master toggle at the top of the settings.
- When on, every line — the averages and the projections alike — uses only confirmed, closed-bar values. Nothing on the chart shifts while the current bar is still forming, and no value changes after it has been drawn.
- The cost is one bar of lag: the display reflects the last completed bar rather than the live, moving one. It is a deliberate trade of immediacy for stability, and it is off by default.
**Complete list of new inputs versus the original**
- One global control at the very top: Non-Repaint.
- Six controls added to each of the three averages (eighteen in total): Show Projection, Projection Length, Slope Lookback, Projection Style, Projection Thickness, and Projection Color.
**How the pieces fit together**
- The averages remain the core of the tool; projections are an optional layer on top of any of them; non-repaint is a global stance that governs how both behave near the live bar.
- With every new feature switched off, the indicator behaves identically to the original upload.
**Worth knowing**
- A projection is a straight-line extension of recent movement, not a forecast. It assumes the average keeps moving in the same direction at the same pace, which real markets do not guarantee. Read it as a directional guide, not a prediction.
- On already-closed bars, moving averages of closing price do not shift regardless of the non-repaint setting; that toggle's real effect is on the still-forming bar and on the projections anchored to it.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.