Strategy Detail
YM/RTY Size Spread
Trades the YM/RTY price ratio as a mean-reversion spread on the large-cap vs small-cap relationship. Long the ratio when it stretches low, short when it stretches high, exit on z-score return to neutral.
Sample runs (3)
What It Does
YM/RTY Size Spread runs on daily bars. On every session close where both legs printed, the strategy:
- Computes the closing price ratio
ratio = YM_close / RTY_close. - Pulls the prior
lookback_daysdaily ratios (default 60), computes their mean and standard deviation. - Computes today’s z-score:
z = (today_ratio - mean) / stdev. - If flat and
z >= entry_z(default 2.0): short the spread by selling YM and buying RTY (the ratio is high relative to history; large caps look stretched against small caps). - If flat and
z <= -entry_z: long the spread by buying YM and selling RTY (the ratio is low; small caps look stretched against large caps). - If in a position and
|z| <= exit_z(default 0.5): flatten both legs.
The strategy has no stops, no profit targets, no holding-period limit. The z-score crossing back through the exit band is the only exit. A spread that keeps stretching against the position is held until it eventually reverts or the backtest ends.
Why Size Spreads Get Used
YM tracks the Dow Jones 30, a basket of US blue-chip large caps. RTY tracks the Russell 2000, US small caps. Both are US equity benchmarks on the same Globex session, so they move in the same direction most of the time, but the relationship between them carries a different signal than either index on its own.
Capital rotates between size buckets in cycles. When risk appetite rises, small caps tend to outperform; when investors crowd into perceived safety, large caps hold up better. That rotation shows up cleanly in the YM/RTY ratio. The spread isolates this relative move and has less directional exposure than either single leg: a broad selloff that hits both indices similarly leaves the spread close to unchanged. The trade pays off when the size relationship mean-reverts, not when the market itself moves.
The flip side: when the size regime structurally shifts (a multi-year period where one segment leads and the other lags by a wide margin), the spread can stretch beyond historical bands and stay there. The strategy does not detect or adapt to regime changes; it keeps placing the same trade.
Notional Balance
YM and RTY are dollar-asymmetric futures. YM is $5 per point; at ~40000, one contract represents ~$200k notional. RTY is $50 per point; at ~2200, one contract is ~$110k notional. The default ym_quantity:rty_quantity of 1:2 brings these closer to balance at typical 2020-era prices, but the strategy does not auto-rebalance as prices drift. Users running it at very different price regimes may want to adjust the leg sizes.
Presets
Five presets cover the canonical variants:
- Classic Z=2 Both Sides: the default starting point. Trades both directions at 2-stdev entry, 0.5-stdev exit.
- Tight Z=1.5 / Wide Z=2.5: narrower or wider entry bands. Tighter fires more often with more whipsaw; wider fires rarely but with cleaner setups.
- Long Spread Only / Short Spread Only: directional variants for when you have a view on which side of the size relationship is more reliable.
Best In
- Periods of moderate but persistent rotation between large caps and small caps.
- Research where you want a market-neutral baseline isolated to the size factor.
- Studies that want to test whether YM-RTY correlation breakdowns produce tradable signals.
Where It Struggles
- Sustained regime changes. 2022 is the obvious example: small caps were repriced hard by rising rates while large caps held up much better. The ratio kept stretching higher and a short-spread position taken on the first 2-stdev signal would have been wrong for months. The strategy does not detect this kind of structural break; it keeps re-entering as the spread stretches further.
- Periods of high overall market volatility. The z-score thresholds were chosen against a 60-day window; in high-vol regimes the same z value represents a much larger dollar move.
- Funding cost is not modeled. Real pair trades have margin requirements on both legs and may have implicit financing costs not reflected in the backtest.
What It Does Not Do
- No stops, no targets, no time-based exit. A spread that never reverts to the exit band stays open.
- No dynamic leg sizing. The
ym_quantity:rty_quantityratio is fixed per preset. - No regime detection. The strategy keeps applying the same z-score rule whether the size relationship is range-bound or trending.
- No adjustment for index changes. Russell reconstitutes annually and Dow components are reshuffled occasionally; the strategy treats prices as continuous.
Presets (5)
Named parameter bundles for this family. Pick one to see its parameters and pre-fill the New Backtest form. The form lets you adjust contract, date range, and capital before running.
Preset
Classic Z=2 Both Sides
Enter when the YM/RTY ratio crosses 2 stdev from a 60-day rolling mean; exit when it returns to 0.5 stdev. Two-sided.
Preset
Tight Z=1.5 Both Sides
Earlier entry at 1.5 stdev. Fires more often than the classic preset; expect lower win rate per trade and more whipsaw.
Preset
Wide Z=2.5 Both Sides
Only trade extreme dislocations beyond 2.5 stdev. Very rare; the few trades that fire tend to resolve cleanly when the size relationship is range-bound.
Preset
Long Spread Only
Only takes long-the-spread setups (long YM, short RTY when large caps have lagged small caps). A tilt for when you believe small-cap leadership is overextended.
Preset
Short Spread Only
Only takes short-the-spread setups (short YM, long RTY when large caps have outperformed). A tilt for when you believe small caps are due to catch up.