Pullback Master
Is there a trend, which pullback is this, and did the last one hold cleanly? Pullback Master finds the trend, counts every pullback that holds inside it and grades how deep each one went. The ribbon shows the count, and the panel in the corner says it in words.

Getting started
- 1Open TradingView and click IndicatorsSearch for "Pullback Master SimpleAlgo" in the Community scripts tab.
- 2Add Pullback Master to your chart
- 3Keep the defaultsThe trend average is 20 bars and the long-term average is 200. Trend strictness is Normal. Depths are measured in ATRs, so the defaults work on gold, crypto and stocks alike.
- 4Add alerts if you want themSet them to "Once per bar close".
What you see on the chart
- The trend average: price smoothed over 20 bars, drawn as a solid line.
- The fan: seven slower averages behind it, from about 1.15 to 2.5 times the trend length. It opens in a trend and folds together in chop.
- The long-term average (200 bars), a thin grey line for context.
- Mint is an uptrend, pink a downtrend, blue no trend. Candles are coloured by trend too.
- No labels. The ribbon's brightness, the panel and the alerts carry the information.
How trends start and end
A trend starts when the trend average has risen (or fallen) steeply enough over the last 5 bars, measured in ATRs, the fan has opened behind it, and a bar closes on the trend side of the average in the trend's direction.
| Strictness | Slope needed over 5 bars |
|---|---|
| Relaxed | 0.15 ATR. More trends, including gentler ones. |
| Normal | 0.25 ATR. The default. |
| Strict | 0.40 ATR. Fewer, cleaner trends. |
If price has closed through the trend average more than twice in the last 20 bars, the market is choppy and no new trend starts. A trend ends when the average turns against it, or when price closes beyond the far side of the fan while the average has stopped rising. A sharp dip inside a strong trend is a deep pullback, not an ending. A trend that comes back in the same direction within 10 bars resumes with its count intact.
How pullbacks are counted
- 1Price moves awayPrice has to get at least 0.75 ATR away from the trend average and stay clear of it for 3 bars since the last pullback.
- 2Price comes backA pullback begins when price gets within 0.2 ATR of the average. The ribbon starts to glow.
- 3Price lifts offThe pullback held when a bar closes back on the trend side of the average with a candle in the trend's direction. The count goes up by one.
Each pullback that held is graded. Its depth is how far past the average price went, in ATRs. It's clean if no bar closed through the average during it, and closed through if one did. The panel also compares the last two depths: getting deeper, getting shallower, or about the same.
The ribbon
The ribbon charges up with each pullback that holds. It's dim at the start of a trend, brightest around the second to fourth pullback, and fades again after the fifth as the trend gets old. While price is at the average the ribbon glows, and the glow dies away over the following bars, so every pullback leaves a soft mark behind it. The Brightness setting scales the whole ribbon.
The panel
| Row | What it shows |
|---|---|
| Trend | Up or down and for how many bars, or None (choppy). |
| Pullbacks | How many have held, whether another is forming, and whether they're getting deeper or shallower. |
| Last pullback | Clean or closed through, and how many ATRs past the average it went. |
| 200 average | Whether price is above or below the long-term average. |
| Last event | Trend started, resumed or ended, or pullback number N held, and how many bars ago. |
Alerts
- New uptrend
- New downtrend
- Pullback held (any pullback)
- Chosen pullback held: the pullback number you set, 3 by default
- Trend ended
Everything is decided on closed bars. Set alerts to Once per bar close.
How to read it
- 1Is there a trend?Mint or pink means yes, blue means no. A choppy reading means stand aside.
- 2Which pullback is this?Early pullbacks come in fresh trends. A high count means an old trend, and the ribbon fades to show it.
- 3How did the last one go?Clean and shallow pullbacks show a trend holding well. Pullbacks getting deeper, or closing through the average, are a trend under strain.
Common questions
Yes. It's free and open source on TradingView, no membership needed.
Trends, pullbacks and the count are decided on closed bars and don't change afterwards. The averages update on the live bar like any moving average.
Yes. Set "Also alert on pullback number" and use the Chosen pullback held alert.
Any. Depths and slopes are measured in ATRs, so the same settings mean the same thing on gold, bitcoin or a stock.