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.

    Pullback Master: the trend average, the fan behind it, the 200 average and the panel.
    Pullback Master: the trend average, the fan behind it, the 200 average and the panel.

    Getting started

    1. 1
      Open TradingView and click Indicators
      Search for "Pullback Master SimpleAlgo" in the Community scripts tab.
    2. 2
      Add Pullback Master to your chart
    3. 3
      Keep the defaults
      The 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.
    4. 4
      Add alerts if you want them
      Set 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.

    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.

    StrictnessSlope needed over 5 bars
    Relaxed0.15 ATR. More trends, including gentler ones.
    Normal0.25 ATR. The default.
    Strict0.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

    1. 1
      Price moves away
      Price 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.
    2. 2
      Price comes back
      A pullback begins when price gets within 0.2 ATR of the average. The ribbon starts to glow.
    3. 3
      Price lifts off
      The 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

    RowWhat it shows
    TrendUp or down and for how many bars, or None (choppy).
    PullbacksHow many have held, whether another is forming, and whether they're getting deeper or shallower.
    Last pullbackClean or closed through, and how many ATRs past the average it went.
    200 averageWhether price is above or below the long-term average.
    Last eventTrend 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

    1. 1
      Is there a trend?
      Mint or pink means yes, blue means no. A choppy reading means stand aside.
    2. 2
      Which pullback is this?
      Early pullbacks come in fresh trends. A high count means an old trend, and the ribbon fades to show it.
    3. 3
      How 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

    Is Pullback Master free?

    Yes. It's free and open source on TradingView, no membership needed.

    Does it repaint?

    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.

    Can I be alerted only on the second or third pullback?

    Yes. Set "Also alert on pullback number" and use the Chosen pullback held alert.

    Which markets and timeframes?

    Any. Depths and slopes are measured in ATRs, so the same settings mean the same thing on gold, bitcoin or a stock.

    Was this page helpful?