Rolling Z-Score Thresholds for Mean-Reversion Buy and Sell Signals
Summary
This strategy standardizes the closing price against its rolling mean and standard deviation. When the Z-score rises above a positive threshold, it closes long positions and opens a short; when it falls below the corresponding negative threshold, it closes shorts and opens a long. A configurable cooldown controls how often another signal can be generated while the score remains beyond a threshold. The document describes the approach as a way to trade price deviations from their recent average, particularly in sideways conditions.
The rolling-window length, threshold, and cooldown are adjustable, and the example settings use a window of 80 bars, a threshold of 2.8, and a five-bar cooldown. The description suggests using stable, correlated pairs and notes the strategy’s reliance on distribution assumptions. However, the supplied code applies the calculation to a single closing-price series and does not implement a pair spread. No backtest results establish effectiveness, and deviations from a rolling mean can persist or reflect a changing trend rather than a reversal. The strategy also allows extensive pyramiding and assumes a stated commission, which affect risk and test outcomes.
Key ideas
- The Z-score measures the close’s distance from its rolling mean in units of rolling standard deviation.
- A score above the positive threshold triggers a short signal, while a score below the negative threshold triggers a long signal.
- Cooldown counters space out repeated signals while the score stays beyond a threshold.
- The description favors sideways markets and discusses correlated pairs, but the code analyzes one price series.
- The document provides example settings but no evidence that the strategy is profitable or robust.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.