Skip to content
All library documents

Intraday SPY–IWM Mean-Reversion Pairs Trading

Article FMZ digest · Author: 善

Summary

This tutorial develops an intraday pairs-trading example using SPY and IWM minute bars. It aligns the two price series, estimates a rolling linear-regression hedge ratio, forms a spread, and standardizes that spread as a z-score. The example opens a long spread when the score moves below a negative entry threshold, opens a short spread above the positive threshold, and exits when the absolute score returns inside a narrower band. It also constructs a simple portfolio return series and varies the regression lookback to examine sensitivity.

The article reports a lookback-dependent backtest pattern and compares the sample equity curve with SPY, but explicitly identifies major limitations. Its z-score uses full-sample spread statistics, introducing look-ahead bias; transaction costs and slippage are omitted; and fractional ETF positions make the portfolio unrealistic. The author warns that these issues could materially weaken the apparent results and calls for a more realistic event-driven backtester. The historical example and parameter analysis therefore illustrate implementation, not a validated arbitrage opportunity or deployable strategy.

Key ideas

  • The strategy aligns SPY and IWM prices before estimating a rolling regression hedge ratio.
  • A z-score of the hedged spread supplies the entry and exit signals for the pair.
  • The example uses separate thresholds to open trades and close them as the spread narrows.
  • Lookback sensitivity analysis illustrates how parameter choice affects the reported backtest.
  • Full-sample standardization creates look-ahead bias, while omitted costs and fractional shares limit realism.

Tags

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