OPEN-SOURCE SCRIPT
30 Min Pivot Enhanced

# 30 Min Pivot Enhanced
The **30 Min Pivot Enhanced** indicator detects pivot reversals and potential buy/sell signals on the 30-minute timeframe. It combines streak-based trend exhaustion with pivot breakouts and optional flush (capitulation) candle detection.
## Core Logic
- Trend streaks: pivots form after consecutive same-color candles (`trendLength`)
- Flush detection: oversized red candles (ATR based) flagged as potential exhaustion
- Pivot candidates:
- Bullish → after a red streak (or flush) followed by a green candle
- Bearish → after a green streak followed by a red candle
- Confirmation: price must break pivot high/low within `maxBarsAfterPivot`
## Inputs
- Consecutive Trend Candles → streak length required for pivot
- Maximum Bars After Pivot → confirmation window
- Show Pivot Lines → toggle pivot levels on chart
- Flush Detection → ATR-based capitulation detection
- Flush Lookback → how many bars to keep flush valid
- Enable Buy/Sell Alerts → toggle trade alerts
## Visuals
- Buy pivots → green "P Buy" labels under price
- Sell pivots → red pivot lines at lows (if enabled)
- Flush markers → optional debug labels showing capitulation bars
## Alerts
- Buy Alert → price breaks above pivot high
- Sell Alert → price breaks below pivot low
---
Best for traders watching **30-minute reversal plays**, especially where exhaustion or flush candles precede a breakout.
The **30 Min Pivot Enhanced** indicator detects pivot reversals and potential buy/sell signals on the 30-minute timeframe. It combines streak-based trend exhaustion with pivot breakouts and optional flush (capitulation) candle detection.
## Core Logic
- Trend streaks: pivots form after consecutive same-color candles (`trendLength`)
- Flush detection: oversized red candles (ATR based) flagged as potential exhaustion
- Pivot candidates:
- Bullish → after a red streak (or flush) followed by a green candle
- Bearish → after a green streak followed by a red candle
- Confirmation: price must break pivot high/low within `maxBarsAfterPivot`
## Inputs
- Consecutive Trend Candles → streak length required for pivot
- Maximum Bars After Pivot → confirmation window
- Show Pivot Lines → toggle pivot levels on chart
- Flush Detection → ATR-based capitulation detection
- Flush Lookback → how many bars to keep flush valid
- Enable Buy/Sell Alerts → toggle trade alerts
## Visuals
- Buy pivots → green "P Buy" labels under price
- Sell pivots → red pivot lines at lows (if enabled)
- Flush markers → optional debug labels showing capitulation bars
## Alerts
- Buy Alert → price breaks above pivot high
- Sell Alert → price breaks below pivot low
---
Best for traders watching **30-minute reversal plays**, especially where exhaustion or flush candles precede a breakout.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。