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.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.