Z-Score Reversionthe distance, stated plainly
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
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.
