Best Pullback Factor Indicator: ATR-Scaled Dip Depth

Written by Dominic Walsh · Published · Last updated

The best pullback factor indicator answers one narrow question. How deep is the current retrace, measured against the volatility of the market it happens in? A 50-period EMA sets the direction, ATR sets the scale, and the pane reports the answer between 0 and 100.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window (levels 40 / 80)
Plots 3: Pullback Factor, Buy-the-dip zone, Sell-the-rally zone
Alerts popup, push notification, email, sound
Inputs 15

What the Best Pullback Factor Indicator draws on the chart

Pullback Factor is the silver line running between 0 and 100 in the lower pane.

Buy-the-dip zone repaints that line dodger blue while an up-trend retrace sits inside the band.

Sell-the-rally zone does the same in orange for the down-trend case.

Level lines mark 40 and 80, and OBJ_ARROW and OBJ_TEXT objects place resumption arrows on the price chart.

  • Pullback Factor: line, silver, width 2
  • Buy-the-dip zone: line, dodger blue, width 4
  • Sell-the-rally zone: line, orange, width 4
Best pullback factor indicator on EURUSD H1 with the 0 to 100 depth pane and shaded dip band
Best pullback factor indicator on EURUSD H1 with the 0 to 100 depth pane and shaded dip band

How the Best Pullback Factor Indicator calculates its values

Reading direction from an EMA slope

iMA supplies EMA(close, `InpTrendPeriod`) at `50`. The code compares that value with its own reading `InpSlopeLen` bars back, which defaults to `5`. A higher value now means an up-trend and a lower one means a down-trend. Nothing else votes on direction.

Measuring depth against ATR

In an up-trend the code takes the highest high of the last `InpLookback` bars and subtracts the close. That distance is the depth. It then divides by `InpAtrMult` times ATR at `InpAtrPeriod`, multiplies by 100 and clamps the result to the pane. A reading of 100 therefore means a four-ATR retrace.

Spotting a resumption

Three things must line up at once. The factor sat inside the `InpDipEnter` to `InpDipMax` band on the previous bar, the factor is easing now, and the close has broken the previous bar high. When all three agree in an up-trend, an arrow lands on the price chart. A down-trend needs a break of the previous bar low instead.

How to read the signals

A reading near 0 means price sits on the swing extreme with no retrace at all.

Readings inside the shaded band mark a retrace deep enough to matter but not yet a break.

Above `InpDipMax` at `95.0` the move has gone past a normal pullback.

Colour carries the direction: blue for an up-trend dip, orange for a down-trend rally.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` ships on with `EnablePopup` carrying the message, while `EnablePushNotify`, `EnableEmail` and `EnableSound` stay off. `SoundFile` names the clip. The check reads bar 1 against bar 2, so one message follows each closed bar.

Every Best Pullback Factor Indicator input

Core settings

Setting What it does Default
InpTrendPeriod Trend EMA period. Trend EMA length, default `50`. Longer keeps you in one direction for more bars. 50
InpSlopeLen EMA slope lookback (bars). Bars used for the slope test, default `5`. Raise it to ignore small wobbles in the EMA. 5
InpAtrPeriod ATR period (depth scale). ATR length feeding the depth scale, default `14`. 14
InpLookback Swing-extreme lookback (bars). Bars searched for the swing extreme, default `20`. This decides what counts as the peak a retrace measures from. 20
InpAtrMult ATR multiple = full-scale (100) depth. ATR multiple that equals a reading of 100, default `4.0`. Lower it to make the pane more sensitive. 4.0
InpDipEnter Buy/sell zone: lower bound. Lower edge of the shaded band, default `40.0`. 40.0
InpDipMax Buy/sell zone: upper bound. Upper edge of the shaded band, default `95.0`. Narrow the gap for stricter marks. 95.0

Display settings

Setting What it does Default
InpArrowOffset Arrow offset (points). Chart arrow offset in points, default `40`. 40
InpArrowLookback Draw arrows over the last N bars. How many recent bars carry arrows, default `1000`. 1000

Alert settings

Setting What it does Default
EnableAlerts (see inputs panel) on
EnablePopup (see inputs panel) on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Best pullback factor indicator inputs: InpTrendPeriod, InpAtrMult, InpDipEnter, InpDipMax
Best pullback factor indicator inputs: InpTrendPeriod, InpAtrMult, InpDipEnter, InpDipMax

Settings that fit your chart

A depth score needs trends to measure inside. EURUSD H1 is the reference chart, where `InpLookback` at `20` covers most of a trading day. On M5 the EMA slope flips faster than the retrace develops, so the colour changes before the reading settles. Higher up, on H4 and daily, each shaded stretch covers a real swing.

When the Best Pullback Factor Indicator fails

The slope test has only two states. A flat market still gets a direction, and the score then measures a retrace that does not exist.

ATR scaling means the same pip distance reads differently in calm and busy weeks. That is the point, but it makes readings hard to compare over time.

A resumption needs a break of the previous bar high or low, which arrives late in a sharp reversal.

Copy the compiled Best Pullback Factor Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Related on forexmt4systems.com: Trend Pullback Strategy.

Background reading on the method behind the Best Pullback Factor Indicator: Multiple factor models on Wikipedia, Heikinashi at Investopedia.

Download the Best Pullback Factor Indicator for MT4 and MT5

The zip holds the compiled Best Pullback Factor Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does InpAtrMult at 4.0 set?

The depth that equals a reading of 100. The code divides the retrace distance by 4.0 times ATR, so a four-ATR pullback fills the pane. Lower the multiple to 2.5 and the same retrace scores higher, which makes the shaded band far easier to reach.

Why does the Pullback Factor line change colour?

Because two extra plots overlay it. Buy-the-dip zone draws dodger blue while an up-trend retrace sits between `InpDipEnter` and `InpDipMax`. Sell-the-rally zone does the same in orange for a down-trend. Outside the band only the silver line remains.

How does InpTrendPeriod decide direction?

It sets the EMA the slope test reads. The code compares EMA(close, 50) with its value `InpSlopeLen` bars earlier. Higher means up and lower means down. There is no neutral state, so the pane always commits to one direction or the other.

Which timeframe suits it on EURUSD?

H1 is the reference chart and a sensible place to start. There `InpLookback` at `20` spans most of a session. Drop to M5 and the slope test flips too often for a depth reading to settle. Move to H4 and each shaded stretch covers a full swing instead.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Best Pullback Factor Indicator as one input. Always backtest before trading live.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment