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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
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.