14.13

⚙️ Systematic Stock Systems

Pairs Trading, Sector Rotation, Turtle/Donchian, Gap Trading, ORB/VWAP, CANSLIM

1. Pairs Trading / Statistical Arbitrage

📈 Stocks🏦 ETFs ↔️
★★★☆☆

Long undervalued + Short overvalued correlated pair (e.g. KO/PEP). Profit from spread convergence via Z-Score entry.

Z-Score of the spread — entry at ±2, exit at 0 (convergence)
Z-ScoreSignalAction
> +2⚡ EntryLong Weaker · Short Stronger
= 0✅ ExitSpread converges
> +3⛔ StopDivergence too large
< -2⚡ EntryReversed pair

Example KO/PEP: Z=+2.3 → Short KO, Long PEP · Hedge ratio β≈0.95

▸ At a Glance
📋 Setup
Correlation ≥ 0.80Z-Score > 2Hold period 5–20 dayssame sector
⚙️ Mgmt
Stop at Z > 3Recalculate hedge ratio dailyclose both legs simultaneously
🎯 Target
Exit at Z = 0Market-neutral base returnno directional market bias
Structure:
  • Identify pair: historical correlation ≥ 0.80, same sector
  • Calculate Z-Score of the spread: entry at Z > +2 (Short Stronger, Long Weaker)
  • Exit at Z = 0 (spread convergence) or stop at Z > +3
  • Derive hedge ratio (beta-neutral) from regression
1
Choose two highly correlated stocks (same sector) whose price ratio has diverged.
2
Go long the weaker one, short the stronger — bet on the ratio returning to its mean (market-neutral).
3
✅ Ratio returns to the mean? Close both sides — profit from the difference.
4
⚠️ Ratio diverges further? Stop on the spread — correlation can break.
5
🔔 Correlation structurally broken (news, sector shift)? Close immediately.
  • ✅ Market-neutral (minimal market risk)
  • ✅ Low beta correlation
  • ✅ Clear entry/exit math
  • ⚠️ Correlation breakdown destroys the trade
  • ⚠️ Short borrow costs
  • ⚠️ Two simultaneous positions required

2. Sector & Asset Rotation

📈 Stocks🏦 ETFs 📈
★★☆☆☆

Rotate capital into the strongest sectors/ETFs by relative strength. Dorsey RS, P&F-BPI and momentum as signal generators.

Strongest sector (Energy) clearly outperforms — RS rating 92, BPI Bull Confirmed → overweight
RankSectorRSBPI
1Energy (XLE)92🟢 Bull
2Technology (XLK)85🟢 Alert
9Utilities (XLU)32🔴 Bear
11Real Estate (XLRE)18🔴 Bear
▸ At a Glance
📋 Setup
RS Rating top quartileBPI Bull ConfirmedMonthly review cycleMax. 4 positions
⚙️ Mgmt
Monthly RS checkRotation on rank changeStop at BPI Bear Confirmedmax. 4 sectors simultaneously
🎯 Target
Profit from momentum effectsystematiclittle individual analysis per position
Structure:
  • Calculate relative strength of all sectors/ETFs (RS rating vs. S&P 500)
  • Top 3 by RS + BPI Bull Confirmed → buy candidates
  • Bottom 3 by RS + BPI Bear Confirmed → underweight / avoid
  • Monthly rotation: rebalance when RS ranking shifts
1
Compare relative strength across sectors — capital flows to leading industries.
2
Invest in the top 1–2 sectors (e.g., via sector ETFs); avoid the weak ones.
3
✅ Sector remains the leader? Hold; let the position run.
4
⚠️ Sector loses relative strength? Rotate into the new leader.
5
🔔 Monthly/quarterly check? Re-rank — rotation is medium-term, not daily.
  • ✅ Systematic & rule-based
  • ✅ Benefits from the momentum effect
  • ✅ Little analysis per position
  • ⚠️ Whipsaw during regime changes
  • ⚠️ Transaction costs with frequent rotation
  • ⚠️ Does not work in sideways markets

3. Turtle Trading / Donchian Breakout

📈 Stocks🛢️ Futures 📈📉
★★★☆☆

Rule-based trend-following system: entry at n-day high/low (Donchian Channel), ATR-based position sizing, mechanical stops. Classic from Richard Dennis's Turtle Experiment (1983).

20-day Donchian Channel — breakout above the high triggers long entry, stop at channel low
System 1System 2
Entry20-day high/low55-day high/low
Exit10-day opposite side20-day opposite side
SignalsMore frequentLess frequent
Stop2 × ATR(20) from entry
Sizing1% risk / 1× ATR = 1 Unit
▸ At a Glance
📋 Setup
20-day high/lowATR(20) for sizing2× ATR stoptrend intact
⚙️ Mgmt
Stop 2× ATR from entrytrail with Donchian opposite sidemax. 4 units per marketno early exits
🎯 Target
Ride large trends fullyrule-based without discretionexit on Donchian opposite-side break
Structure:
  • System 1: breakout above 20-day high → Long; below 20-day low → Short
  • System 2: breakout above 55-day high → Long; below 55-day low → Short
  • Stops: 2× ATR(20) from entry, trail with Donchian opposite side
  • Position sizing: 1% risk per trade / 1× ATR(20) as 1 Unit
1
Use the Donchian Channel: enter on a breakout above the 20- (or 55-)day high.
2
Size positions by volatility (ATR) — keep risk per trade constant.
3
✅ Trend running? Trail with the 10-day low as your stop.
4
⚠️ Price falls below the exit channel? Exit mechanically — no debate.
5
🔔 System discipline? Take every breakout; no subjective filtering.
  • ✅ Fully rule-based → ideal for backtesting
  • ✅ Historically profitable trend following
  • ✅ No room for interpretation
  • ⚠️ Many false breakouts in sideways markets
  • ⚠️ Large drawdowns
  • ⚠️ Discipline required during losing entries

4. Gap Trading (Gap-and-Go / Gap-Fill)

📈 Stocks 📈📉
★★★★☆

Use opening gaps as setups: Gap-and-Go (continue momentum) or Gap-Fill (mean-reversion to prior-day close gap). Clear setup with daily reference.

Gap-Up: open significantly above prior-day close — Gap-and-Go (momentum) or Gap-Fill (reversal)
Gap-and-GoGap-Fill
ExpectationMomentum continuesPrice reverts
Entry5-min above gap highReversal candle
TargetMeasured movePrior-day close
StopBelow gap levelAbove gap high
▸ At a Glance
📋 Setup
Gap > 1%Pre-market volume elevatedno earnings gapStop < gap level
⚙️ Mgmt
Only trade gaps > 1%Avoid earnings gapsclose position intradaystop at gap level
🎯 Target
Gap-and-Go: measured move from openGap-Fill: full fill to prior-day close
Structure:
  • Pre-market: gap screener > 1% or < -1% vs. prior-day close
  • Gap-and-Go: first 5-min candle holds above gap level → entry with momentum
  • Gap-Fill: price turns back toward prior-day close → counter-trend entry
  • Stop: below/above the gap level (invalidation)
1
Pre-market: screen for stocks with a gap > 1% and elevated volume.
2
Gap-and-Go: does the first bar hold above the gap level? → Long with momentum, stop below the gap. Gap-Fill: does price reverse toward the prior close? → Counter-trade.
3
✅ Move running? Take partial profits; trail the stop.
4
⚠️ Earnings gap? Avoid — unpredictable.
5
🔔 Before market close? Flatten intraday — no overnight risk.
  • ✅ Clear daily-reference setup
  • ✅ High daytrading search volume
  • ✅ Quick resolution (intraday)
  • ⚠️ Earnings gaps unpredictable
  • ⚠️ Requires pre-market monitoring
  • ⚠️ High trade frequency demands discipline

5. Opening Range Breakout (ORB) / VWAP

📈 Stocks 📈📉
★★★★☆

Breakout from the first 15/30-minute range or VWAP as dynamic support/resistance. Daytrading standard in US markets, easily systematized.

Opening Range (first 15 min) as yellow zone — breakout above OR-High triggers long entry
SetupEntryStop
ORB LongPrice > OR-HighBelow OR-Low
ORB ShortPrice < OR-LowAbove OR-High
VWAP LongPullback to VWAPBelow VWAP

⚠️ Requires intraday data (15m/30m) — no backtesting with daily candles.

▸ At a Glance
📋 Setup
First 15/30 min rangeVolume > 1.5× avgVWAP as direction filterSession 09:30–11:30 ET
⚙️ Mgmt
Stop at opposite range levelno holding through lunchuse VWAP as re-entry filter
🎯 Target
ORB: 2× range widthVWAP trade: resistance/supportintraday exit
Structure:
  • Opening Range: first 15 or 30 minutes → define High/Low as range
  • ORB entry: breakout above OR-High (Long) or below OR-Low (Short) with elevated volume
  • VWAP: price above VWAP = bullish bias; pullback to VWAP = long entry
  • Stop: below OR-Low (Long) or above OR-High (Short)
1
Define the Opening Range: the high and low of the first 15–30 minutes.
2
Use VWAP as a directional filter: above VWAP = bullish bias; pullback to VWAP = entry.
3
✅ Breakout above OR high with volume? Long; stop below OR low (mirror for short).
4
⚠️ Price falls back into the range? Failed breakout — get out.
5
🔔 Midday / market close? Don't hold through the midday lull; close intraday.
  • ✅ Daytrading standard
  • ✅ Clear range as anchor
  • ✅ VWAP universally used
  • ⚠️ Requires intraday candles (no daily backtest)
  • ⚠️ Requires active monitoring
  • ⚠️ Only in volatile sessions

6. CANSLIM (William O'Neil)

📈 Stocks 📈
★★★☆☆

William O'Neil's 7-criteria system for growth stocks: Current/Annual Earnings, New, Supply/Demand, Leader, Institutional, Market Direction.

Cup-with-Handle + volume spike on breakout — CANSLIM entry at pivot above the base
Crit.ThresholdTool?
C / AEPS +25% YoY⚠️ manual
N52W high breakout✔ Range52W
SVolume spike✔ OBV/Vol
LRS rating ≥ 80✔ RS
I≥ 3 funds holding⚠️ manual
MMarket in uptrend✔ BPI
▸ At a Glance
📋 Setup
EPS +25%RS rating ≥ 80Breakout from base (Cup, VCP) with volumeMarket in uptrend
⚙️ Mgmt
Stop 7–8% below entryTrailing at 20–25% paper profitonly in confirmed market uptrend
🎯 Target
Growth stocks in early trend accelerationPivot from base as entryCompound over multiple legs
Structure:
  • C + A: EPS last quarter ≥ +25% YoY AND 3-year growth ≥ 25% p.a.
  • N: new product/management OR 52W high breakout from consolidation base
  • S + L: volume spike on breakout, RS rating ≥ 80 in the industry
  • I + M: min. 3–5 institutional funds holding; overall market in uptrend
1
C + A: EPS growth current and multi-year ≥ 25%.
2
N + S + L: new product/high, volume spike on breakout, RS Rating ≥ 80. Enter at the pivot from a base.
3
✅ Breakout running? Trail your stop; let winners run.
4
⚠️ 7–8% below entry? Stop — limit the loss.
5
🔔 Market direction (M)? Only trade in a confirmed market uptrend.
  • ✅ Fundamentals + technicals combined
  • ✅ Historically strong win rate in bull markets
  • ✅ Clear 7-criteria checklist
  • ⚠️ Access to fundamental data required
  • ⚠️ Only works in bull markets
  • ⚠️ Very similar to Minervini template

7. From Setup to System: Backtesting Methodology

The six systems in this module are rule-based and therefore testable. A setup only becomes a system once its rules show a positive expectancy across many trades. Backtesting is the meta-discipline that separates a plausible setup from a viable system.

In-Sample, Out-of-Sample & Walk-Forward

Split the history: on the in-sample period you develop and optimise the rules, on the held-back out-of-sample period you test them on unseen data. The walk-forward analysis rolls this window forward repeatedly (optimise → test → shift) and is the toughest test: it simulates how the system would be re-tuned periodically in reality.

Spotting curve-fitting / overfitting

The most common self-deception: you optimise the rules until the past looks perfect, and then fail in the future. Warning signs:

  • Too many parameters or „special rules" for individual market phases.
  • A suspiciously smooth, almost linear equity curve.
  • Performance collapses out-of-sample.

Evaluation metrics

MetricWhat it measures
Profit factorGross profit ÷ gross loss. > 1 = profitable, robust from ~1.5.
Expectancy (R-multiple)Average win or loss per trade in multiples of the risk (1R) — the core expected value.
Max drawdownLargest peak-to-trough capital decline — decides whether you can psychologically stick with the system.
CAGR / MAR ratioAnnual return, or annual return ÷ max drawdown — return relative to pain.
Sharpe / SortinoReturn per unit of risk; Sortino penalises only downside volatility.
Win rate × R/RWin probability times reward-to-risk — a low win rate can be offset by a high reward-to-risk ratio.

Avoiding biases

BiasTrap
Survivorship biasTesting only names that still exist today — bankruptcies and delistings are missing and flatter the result.
Look-ahead biasUsing data that was not actually available at trade time (e.g. closing prices for an intraday decision).
Ignoring costsWithout realistic slippage + commission every high-frequency system becomes artificially profitable.

🎯 From backtest to forward test: A backtest remains a hypothesis about the past. The consistent forward test is your real trading journal: with sTraderZ.com you document every trade and evaluate it via strategy tags and dimensions — so you can see whether the edge found in the backtest also holds live.