OPEN-SOURCE SCRIPT
Pivot Points [DecodingFlowLab]

Pivot Points [DecodingFlowLab]
A clean and lightweight pivot structure indicator designed to detect significant swing highs and swing lows directly from market structure.
This tool uses a symmetric pivot detection model based on a configurable depth value to identify confirmed turning points in price action.
━━━━━━━━━━━━━━
How It Works
━━━━━━━━━━━━━━
• The indicator scans both sides of the candle using the selected “Depth” value.
• A Pivot High is confirmed only when the candle’s high is greater than the highs of surrounding candles.
• A Pivot Low is confirmed only when the candle’s low is lower than the lows of surrounding candles.
• Signals are plotted only after confirmation to reduce market noise and false swings.
━━━━━━━━━━━━━━
Smart Filtering Logic
━━━━━━━━━━━━━━
The script includes an internal directional filtering mechanism:
• If a new higher pivot high appears, the previous pivot high is automatically replaced.
• If a new lower pivot low appears, the previous pivot low is replaced as well.
This creates a cleaner market structure view and prevents unnecessary duplicate pivots.
━━━━━━━━━━━━━━
Features
━━━━━━━━━━━━━━
✔ Clean visual swing detection
✔ Dynamic replacement of weaker pivots
✔ Adjustable pivot sensitivity using “Depth”
✔ Offset plotting to avoid candle overlap
✔ Lightweight and optimized
✔ Useful for market structure analysis
✔ Can assist with:
• Swing Trading
• Trend Analysis
• Liquidity Mapping
• BOS / CHOCH concepts
• Support & Resistance identification
━━━━━━━━━━━━━━
Inputs
━━━━━━━━━━━━━━
• Depth
Controls pivot sensitivity.
Higher values = stronger but fewer pivots.
• plotShift
Moves pivot markers away from candles for better chart visibility.
• Pivot Colors
Custom colors for highs and lows.
━━━━━━━━━━━━━━
Best Use Cases
━━━━━━━━━━━━━━
This indicator works especially well for:
• Market Structure traders
• Smart Money Concept (SMC) traders
• Swing traders
• Liquidity-based analysis
• Manual chart markup
━━━━━━━━━━━━━━
Important Note
━━━━━━━━━━━━━━
Because pivots require future candle confirmation, signals appear after the structure is confirmed.
This behavior is intentional and helps filter out weak or temporary swings.
Built by DecodingFlowLab.
Disclaimer
This indicator is provided for educational and informational purposes only and should not be considered financial advice, investment advice, or a recommendation to buy or sell any financial instrument.
The indicator does not provide guaranteed entry or exit signals for trading positions. Financial markets involve significant risk, and past performance does not guarantee future results.
Users are solely responsible for their own trading decisions, risk management, and use of this indicator in any market or trading environment.
The publisher, developer, and distributor of this indicator assume no responsibility or liability for any financial losses, damages, or outcomes resulting from the use or misuse of this indicator.
A clean and lightweight pivot structure indicator designed to detect significant swing highs and swing lows directly from market structure.
This tool uses a symmetric pivot detection model based on a configurable depth value to identify confirmed turning points in price action.
━━━━━━━━━━━━━━
How It Works
━━━━━━━━━━━━━━
• The indicator scans both sides of the candle using the selected “Depth” value.
• A Pivot High is confirmed only when the candle’s high is greater than the highs of surrounding candles.
• A Pivot Low is confirmed only when the candle’s low is lower than the lows of surrounding candles.
• Signals are plotted only after confirmation to reduce market noise and false swings.
━━━━━━━━━━━━━━
Smart Filtering Logic
━━━━━━━━━━━━━━
The script includes an internal directional filtering mechanism:
• If a new higher pivot high appears, the previous pivot high is automatically replaced.
• If a new lower pivot low appears, the previous pivot low is replaced as well.
This creates a cleaner market structure view and prevents unnecessary duplicate pivots.
━━━━━━━━━━━━━━
Features
━━━━━━━━━━━━━━
✔ Clean visual swing detection
✔ Dynamic replacement of weaker pivots
✔ Adjustable pivot sensitivity using “Depth”
✔ Offset plotting to avoid candle overlap
✔ Lightweight and optimized
✔ Useful for market structure analysis
✔ Can assist with:
• Swing Trading
• Trend Analysis
• Liquidity Mapping
• BOS / CHOCH concepts
• Support & Resistance identification
━━━━━━━━━━━━━━
Inputs
━━━━━━━━━━━━━━
• Depth
Controls pivot sensitivity.
Higher values = stronger but fewer pivots.
• plotShift
Moves pivot markers away from candles for better chart visibility.
• Pivot Colors
Custom colors for highs and lows.
━━━━━━━━━━━━━━
Best Use Cases
━━━━━━━━━━━━━━
This indicator works especially well for:
• Market Structure traders
• Smart Money Concept (SMC) traders
• Swing traders
• Liquidity-based analysis
• Manual chart markup
━━━━━━━━━━━━━━
Important Note
━━━━━━━━━━━━━━
Because pivots require future candle confirmation, signals appear after the structure is confirmed.
This behavior is intentional and helps filter out weak or temporary swings.
Built by DecodingFlowLab.
Disclaimer
This indicator is provided for educational and informational purposes only and should not be considered financial advice, investment advice, or a recommendation to buy or sell any financial instrument.
The indicator does not provide guaranteed entry or exit signals for trading positions. Financial markets involve significant risk, and past performance does not guarantee future results.
Users are solely responsible for their own trading decisions, risk management, and use of this indicator in any market or trading environment.
The publisher, developer, and distributor of this indicator assume no responsibility or liability for any financial losses, damages, or outcomes resulting from the use or misuse of this indicator.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.