OPEN-SOURCE SCRIPT

30 Min Pivot Enhanced

846
# 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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.