← Strategy library

Z-Score Reversionthe distance, stated plainly

Evidence: ModerateProfessionalMean reversion · Statistical

Every band on this page is a z-score wearing a costume. This page takes the costume off: z = (price − mean) ÷ standard deviation, computed over a fixed lookback, and the rule is a number rather than a line on a chart.

The advantage is that the threshold is comparable across instruments and timeframes. A −2 on gold and a −2 on EURUSD mean the same thing, which no pip-based rule can claim.

The evidence here is for reversion itself, not for this particular measure of it. The ruler below is a way of deciding when price has stretched far enough — it is not what makes it come back.

Category
Mean reversion · Statistical
Timeframe
H1 primary · any, since the measure is scale-free
Suitable pairs
Any liquid instrument — that is the point of the measure
Session
Signal at the bar close · session-independent
Indicators / tools
Rolling mean and standard deviation over 50 bars · ATR(14). Implemented in Pine or Python.

Valid setup

MR-03 · Z-SCORE REVERSION — VALID SETUP XAUUSD · H1 · z falls below −2.0 against the 50-bar mean, then closes back above it LONG 4361.48 4370.10 4378.73 4387.36 4395.99 4404.62 4413.25 to the mean 1R 50-bar mean — z is zero here TARGET = z is zero ENTRY STOP 1 2 3 4 4398.39 4385.00 4368.00 z-score (50) +2 0 −2 ① Price drifts away from the 50-bar mean ② z closes below −2.0 — two deviations, whatever the instrument ③ Stationarity check passed: z has crossed zero often enough ④ z closes back above −2.0 — enter at that close ⑤ Stop stated in the same units: z = −3.0 ⑥ Target z = 0. Never past it

Exact rules

Entry

  • z = (close − 50-bar mean) ÷ 50-bar standard deviation, computed on closes.
  • Setup: z closes below −2.0.
  • Trigger: z closes back above −2.0.
  • Enter at that bar's close. Mirror above +2.0 for shorts.
  • Stationarity check: run it only on instruments whose z has crossed back through zero at least twenty times in the last five hundred bars. If it has not, the series is trending and there is no mean to revert to.

Stop loss

  • At z = −3.0, converted back to a price. The stop is stated in the same units as the signal, which is the whole reason for using this measure.
  • Risk 0.5%–1%.
  • If z has not turned within ten bars of entry, exit. The distribution has moved.

Take profit / exit

  • z = 0 — the mean itself.
  • A partial at z = −1.0 is a reasonable variant, tested separately.
  • Never past zero. Beyond the mean you are trading momentum in the other direction, not reversion.

Build Z-Score Reversion

Reading this page is free and always will be. Taking it is what costs — the complete MQL5 for the rules above, yours to keep, permanently. Five of them cost $10 and they never expire.

More from Mean reversion

Trading carries risk and most retail accounts lose money. Nothing on this page is financial advice or a recommendation to trade. The chart is an illustration of the rules on constructed candles — it is not a record of a trade and not a backtest.