Skip to content
All library documents

Auditing a Z-Score Mean-Reversion Indicator and Its Backtest

Article ProRealCode

Summary

The article examines a z-score indicator whose automatic lookback selection is described as machine learning. It selects among ten fixed windows using price-trend fit, then trades z-score extremes as mean-reversion signals. The audit identifies problems in the logic: maximizing trend fit conflicts with range-bound mean reversion, the extreme trigger is self-satisfying, a counter does not reset correctly, raw-price z-scores can be distorted by trends, and the take-profit calculation is not a meaningful price target.

The revised approach selects the window with the lowest trend fit, can use regression residuals, and offers regime filters, a cross-back trigger, ATR stops, reward-to-risk screening, cooldowns, and trade tracking. Results were mildly positive on some tested markets and timeframes but not robust across instruments and timeframes. The author presents it as a study tool, not a stand-alone signal, and cautions that extra filters can overfit without out-of-sample validation. The tests described are limited and do not establish broad profitability.

Key ideas

  • The indicator’s fixed-window selection is not machine learning, and selecting the strongest trend conflicts with mean reversion.
  • A trigger based on the current value being the rolling-window extreme can fire by definition.
  • A cross back from an extreme can signal that reversion has begun, while regression residuals can reduce trend bias.
  • Stops, regime filters, reward-to-risk screening, and cooldowns add risk controls but do not prove robustness.
  • The reported backtest results vary by instrument and timeframe, so the indicator is presented as a study tool.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.