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.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。