OPEN-SOURCE SCRIPT
Swing Pivot Pullback Detector

Identifies pullback movements that occur immediately after a confirmed swing pivot in price.
It focuses on recognizing how deep the retracement travels relative to the most recent price leg, helping traders visualize short-term corrections that often precede trend continuations or reversals.
How It Works
- The script uses built-in pivot logic to confirm swing highs and lows, defined by a user-set number of left and right bars.
- Once a pivot of the opposite type forms, the indicator measures the retracement that develops from the end of that leg.
- When a valid pullback is found, a small label appears on the chart showing the percentage size of that retracement compared to the previous pivot leg.
- Optional alerts can notify the user when a pullback exceeds the specified minimum retrace percentage.
Inputs
- Pivot left/right bars: define how far back and forward a swing point must extend to be confirmed.
- Lookback: limits how many bars are scanned when searching for the pullback extreme.
- Min retrace %: sets the smallest correction percentage to trigger an alert.
- Show label / Enable alert: toggle visual or alert output.
Usage
This tool is most useful for visual analysis of price rhythm, measuring the strength of retracements within ongoing swings.
It does not generate trade signals on its own but can complement manual or algorithmic methods that rely on pullback structure or market symmetry.
Skrip open-source
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Pernyataan Penyangkalan
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.
Skrip open-source
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Pernyataan Penyangkalan
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.