Stop Reversal Indicator: A Stop Line That Only Ratchets

Written by Dominic Walsh · Published · Last updated

The stop reversal indicator draws a line that never loosens. In an uptrend it sits three range units below the high and can only rise. When a close finally breaks it, the line jumps to the other side of price and starts again.

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 Main price chart
Plots 4: StopRev Up, StopRev Down, Buy Flip, Sell Flip
Alerts popup
Inputs 4

What the Stop Reversal Indicator draws on the chart

`StopRev Up` carries the line in dodger blue while it sits below price.

`StopRev Down` carries it in tomato while it caps price from above.

`Buy Flip` uses arrow 233 and `Sell Flip` uses 234 on the bar that breaks it.

Marks sit `InpArrowOffset` `12` points from the candle.

  • StopRev Up: line, dodger blue, width 2
  • StopRev Down: line, tomato, width 2
  • Buy Flip: arrow, lime, width 2, arrow code 233
  • Sell Flip: arrow, red, width 2, arrow code 234
Stop reversal indicator ratcheting stop line and flip arrows on the EURUSD H1 chart.
Stop reversal indicator ratcheting stop line and flip arrows on the EURUSD H1 chart.

How the Stop Reversal Indicator calculates its values

Distance comes from range

iATR at `InpAtrPeriod` `14` measures the bar. `InpAtrMult` `3.0` sets how far the stop hangs from the extreme, so the line widens when the market speeds up.

The ratchet

While direction reads up, the code keeps the higher of the new candidate stop and the previous one. That line therefore holds or rises and never falls. A downtrend mirrors the same rule.

A close decides the flip

Direction changes only when a close finishes on the wrong side of the line. Wicks through it change nothing, which is what keeps a single spike from ending a run.

How to read the signals

Line colour is the current direction, and it changes only at a flip.

The gap between price and the line shows how much room the move has left.

A wide `InpAtrMult` means flips are rare and each one gives back more.

The very first bars seed direction from whether the close rose or fell.

Alert channels in this build: popup, one message per closed bar.

A single route exists here. `InpAlertOnFlip` arrives true and posts a terminal message when the line changes sides. No handset, mail or sound option ships in this build. The guard keeps it to one message per closed bar.

Every Stop Reversal Indicator input

Core settings

Setting What it does Default
InpAtrPeriod ATR Period. Bars in the range reading, default `14`. 14
InpAtrMult ATR Multiplier. Range units between the extreme and the stop, default `3.0`. 3.0

Display settings

Setting What it does Default
InpArrowOffset Arrow Offset (points). Points between a flip mark and the candle, default `12`. 12

Alert settings

Setting What it does Default
InpAlertOnFlip Alert On Flip. Terminal message when the line flips sides, default `true`. on
Stop reversal indicator inputs panel showing InpAtrPeriod and InpAtrMult.
Stop reversal indicator inputs panel showing InpAtrPeriod and InpAtrMult.

Settings that fit your chart

A three range unit stop is wide. EURUSD H1 is the reference chart, where flips arrive every few days. On M5 the line still filters most noise. H4 and daily turn it into a position tool with very few flips.

When the Stop Reversal Indicator fails

A wide stop gives back a lot of a move before it flips.

In a range price crosses the line repeatedly and each crossing costs.

Only one alert route ships, so there is no handset or mail option.

Copy the compiled Stop Reversal 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.

Background reading on the method behind the Stop Reversal Indicator: Technical analysis on Wikipedia, Resistance at Investopedia.

Download the Stop Reversal Indicator for MT4 and MT5

The zip holds the compiled Stop Reversal 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 3.0 control?

How far the stop sits from the recent extreme, counted in range units. Three is wide, so normal pullbacks cannot reach it. Lowering it toward two flips sooner and considerably more often.

Why does the StopRev Up line never fall?

Because while direction reads up, the code keeps whichever is higher between the new candidate and the previous value. That ratchet is what turns a distance calculation into a trailing stop.

Can a wick flip the StopRev Up line?

No. The test reads the close only. A spike that pierces the line and pulls back within the same bar leaves the direction untouched, which is what stops one volatile candle ending a long run.

What does InpAtrPeriod 14 feed?

The range reading that sets the stop distance. A shorter period makes the line react faster to a change in conditions, which tightens the stop sooner after a quiet stretch begins.

Are results guaranteed?

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

Category: this is part of our Signal and Forecast collection. Browse more Signal and Forecast for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

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