Adapted from the FMZ digest article by 善, 'A mean-reversion intraday trading strategy using SPY and IWM' (https://www.fmz.com/digest-topic/3991, sections '策略' and 'Python实现'). The source trades SPY vs IWM on 1-MINUTE bars: a rolling 100-bar OLS of SPY price on IWM price gives the hedge ratio, spread = SPY - beta*IWM, z-score of the spread, enter at |z|=2, exit at |z|=1. The author says it has two flaws: the z-score uses the full-sample mean and std, which is look-ahead, and there are no transaction costs. We keep the mechanism, which is that large-cap and small-cap US equity indices are driven by the same macro factor, so short-run divergence in their beta-adjusted spread tends to close. We fix the flaws and move it to a timeframe where it can clear costs. (1) TIMEFRAME: at 1m, a 100-bar spread std is only a few bps. Reverting from z=2 to z=1 captures about 1 std, roughly 0.03-0.05% of notional, which is below the two-leg USEQ round trip of about 0.06-0.10% (spread plus impact on each leg). The 1m and 1h catalogs also hold only about 6 weeks and about 2 years of data. We therefore use DAILY bars, which cover SPY.USEQ and IWM.USEQ back to IWM's inception in May 2000 (about 26 years). (2) NO LOOK-AHEAD: the hedge ratio, spread mean and spread std are all rolling and computed from sessions strictly before the decision bar's close. (3) HEDGE RATIO: we use a rolling 60-session OLS beta of IWM daily log-returns on SPY daily log-returns, not a regression of price levels, because a price-level OLS on two non-stationary series gives a spurious and drifting ratio. Spread_t = ln(IWM_t) - beta*ln(SPY_t), and z_t = (spread_t - mean20)/std20 over the prior 20 sessions. (4) EXECUTION: both legs are traded at the next session's open on the USEQ Reg-T margin account, with whole shares. Size is dollar-neutral after beta weighting: IWM notional N and SPY notional beta*N, rounded to whole shares. SPY and IWM are the two most liquid ETFs in the US, so the fractional-share and cost concerns the author raised do not apply at $100k. Scope note: lesson L137 warns against multi-leg neutral books. This is not a basket. It is a 2-leg pair of the two deepest US ETFs, so costs on USEQ are about 1/10 of crypto costs per leg and the per-trade capture below is about 15-30x the round trip. That is why a 2-leg design is kept here: the pair spread is the user's mechanism, and it cannot be expressed on a single leg without adding the index beta (L143). Parameters: 4 core parameters (hedge_window=60, z_window=20, z_entry=2.0, z_exit=0.5), plus a time stop of 10 sessions and a blow-up stop at |z|>=4.0. The optimizer should not widen the hedge_window/z_window grid beyond about ±50%.