OPEN-SOURCE SCRIPT
Pivot point moving averages

Pivot Point Moving Averages builds moving averages from confirmed pivots, not from every bar.
Instead of averaging all highs and lows, this script:
Because the lines only move when a new pivot is confirmed, they represent structural acceptance rather than raw volatility. Short “noise” moves and stop hunts between pivots have much less impact on these averages.
You can also enable an optional second pivot MA cloud:
Why it’s useful
Traditional MAs:
This tool uses confirmed pivots, so it is better suited to market structure and phase analysis:
Typical interpretations:
With the second cloud enabled on a higher timeframe, you can:
Notes
Instead of averaging all highs and lows, this script:
- Detects swing pivot highs and pivot lows using a configurable Pivot length (pivotLen).
- Converts these sparse pivot prices into continuous series of:
- last confirmed pivot low
- last confirmed pivot high
- Applies a user-selectable moving average (SMA / EMA / RMA / WMA / VWMA) to each of those pivot series.
- Plots the two resulting lines and shades the area between them as a pivot value cloud.
Because the lines only move when a new pivot is confirmed, they represent structural acceptance rather than raw volatility. Short “noise” moves and stop hunts between pivots have much less impact on these averages.
You can also enable an optional second pivot MA cloud:
- Uses the same Pivot length for structural detection.
- Has its own MA length and type.
- Can run on a different timeframe (e.g. D, 240, W).
- Is projected back onto the current chart so you see local pivot value and higher-timeframe pivot value together.
Why it’s useful
Traditional MAs:
- React to every bar.
- Move on noise, wicks, and stop runs.
- Don’t distinguish between “meaningful” structure and random fluctuation.
This tool uses confirmed pivots, so it is better suited to market structure and phase analysis:
- Pivot MA low reflects how demand is stepping up (or down) as new swing lows form.
- Pivot MA high reflects how supply is pressing down (or easing) as new swing highs form.
- The cloud between them acts as a dynamic, structure-based value area.
Typical interpretations:
- Price inside the pivot cloud → balance / fair value area.
- Price above the pivot cloud → bullish value expansion.
- Price below the pivot cloud → bearish value expansion.
- Cloud compressing → possible energy build-up, transition between phases.
- Cloud expanding → stronger directional conviction.
With the second cloud enabled on a higher timeframe, you can:
- See whether lower-timeframe structure is building with or against the higher-timeframe pivot value.
- Use the HTF cloud as a background bias and the LTF cloud for timing and fine-grained context.
Notes
- All pivot-based tools have inherent delay: a pivot is only confirmed after pivotLen bars to the right.
- On very low timeframes, long pivotLen + long MA lengths will make the lines slower to react.
- This is intended as a context and structure tool, not a standalone entry signal.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.