The Learning Library
Contents

Module 11 Companion — Intraday Mean Reversion Playbook

Part III · Intraday Design, Alpha & Playbooks · Companion to Module 11 Prerequisites: M5, M6, M8, M9, M22, M23


Overview

The core module established our unified intraday replay contract: completed bars only, close-on-t signal to open-on-t+1 execution, full observed spread deducted, ambiguous bars resolved adversely, and mandatory same-session flattens. This companion provides three concrete, reproducible trading experiments for commodity ETPs and BTC/ETH derivatives:

Strategy Card Anchor Family Target Venues & Clocks Core Empirical Question
S1 — Bollinger/RSI Fade Bollinger(20,2) + RSI(2) with close-back-inside trigger Commodity ETP RTH (09:30–16:00 ET) & BTC/ETH Perp (00:00–23:50 UTC) Does volatility-adapted exhaustion snap back to the rolling mean after fees?
S2 — Session-VWAP Reversion Session VWAP $\pm 2\sigma$ deviation envelope Same lanes, M5 primary (M15 sensitivity) Does volume-weighted cost deviation provide positive expectancy when VWAP slope is flat?
S3 — Prior-Level Sweep Rejection Prior regular-session High/Low (PDH/PDL) Same lanes, M5 primary Does fading a failed pierce of yesterday’s extremes capture profitable range returns?

💡 The Rubber Band & Clearance Rack: Mean-reversion signals are clearance sale alerts. The extreme price dislocation (the markdown) is the alert; the close back inside the band is the proof that the first buyer has stepped in. You buy the clearance item only after the markdown stops, targeting wholesale fair value (VWAP or the rolling mean).

📌 Data Contract Convention: All strategies operate strictly on OHLCV + observed spread. No tick data, order-book depth, or partial fills are assumed. Signals generated at close[t] fill at open[t+1] with full observed spread deducted. Higher-timeframe bars (H1/D1) serve purely as causal context gates joined at their release timestamps. All trades flatten before session close.


How It Works

Three strategy families share a modular decision architecture and identical execution constraints:

  1. S1 (Bollinger/RSI Fade): Detects price beyond Bollinger Bands ($2\sigma$) combined with RSI(2) exhaustion ($< 10$ or $> 90$) TradingCompendium on RSI + Bollinger 2026. An M5 close back inside the band arms an entry toward the 20-period moving average TradingPlan on Bollinger band mean reversion.
  2. S2 (Session-VWAP Reversion): Anchors to cumulative intraday volume-weighted average price AlgoLab on VWAP mean reversion. Price stretching beyond $2\sigma$ triggers an entry upon closing back inside, provided the 14-period VWAP slope confirms a non-trending regime MomentumIQ on VWAP mean reversion.
  3. S3 (Prior-Level Sweep): Monitors prior-day regular trading hours extremes (PDH/PDL) DayTradingToolkit on prior-day high/low. When price wicks beyond the level by an ATR buffer but closes back inside the prior range, the engine fades the false breakout NetPicks on previous day high/low.

All setups must pass pre-trade spread / ATR and cost / target hurdles before execution.

Figure: Reversion playbook execution architecture. S1 serves as the volatility benchmark, S2 tests volume-weighted institutional cost, and S3 evaluates structural level rejections.

flowchart TD
    data["OHLCV + spread<br/>M5 + completed H1/H4/D1 releases"] --> s1["S1 Bollinger/RSI<br/>band + RSI(2) -> back-inside"]
    data --> s2["S2 VWAP Reversion<br/>2 sigma band -> reclaim"]
    data --> s3["S3 Prior-Level Fade<br/>PDH/PDL pierce -> close-back"]
    s1 -->|"frozen ATR exit & gates"| ablate["Same-engine ablation<br/>anchor vs no-anchor<br/>vs cost-stress vs paper"]
    s2 --> ablate
    s3 --> ablate
    ablate --> decision{"Net lift +<br/>opportunity floor +<br/>ambiguous share?"}
    decision -->|"pass"| carry["Carry to paper<br/>as one-lane playbook"]
    decision -->|"revise"| narrow["Revise: tighten σ or buffer<br/>swap M5/M15<br/>or gate ADX/slope"]
    decision -->|"reject"| reject["Reject family<br/>document & stop spend"]

    classDef data fill:#e8f0fe,stroke:#4a86e8
    classDef process fill:#f3f3f3,stroke:#888
    classDef decision fill:#fff4d6,stroke:#d6a300
    classDef risk fill:#fde8e8,stroke:#c0392b
    classDef ok fill:#e6f4ea,stroke:#2e7d32

    class data data
    class s1,s2,s3,ablate,narrow process
    class decision decision
    class reject risk
    class carry ok

Strategy Rules

Every strategy card adheres to the standard 9-point research template. S1 details the full baseline implementation; S2 and S3 specify structural deltas.

S1 — Bollinger/RSI Confluence Fade (Full Implementation)

1. Market, Timeframe, and Data Assumptions

  • Instruments: GLD / PDBC (NYSE Arca ETPs) and BTC/ETH Linear Perpetuals (Approved CEXs).
  • Timeframe: M5 primary decision bars.
  • Clock: ETP: 09:30–16:00 ET (forced flatten at 15:58 ET); Crypto: 00:00–23:50 UTC (forced flatten at 23:50 UTC).
  • Data Basis: OHLCV + observed spread per bar. Long-only default for ETPs; two-sided for crypto perps.

2. Mechanics vs. Testable Hypothesis

Mechanics literature documents Bollinger Band standard-deviation properties and RSI momentum exhaustion TradingCompendium on RSI + Bollinger 2026.

  • Hypothesis: Entering on the first M5 bar closing back inside Bollinger Bands(20,2) following an RSI(2) extreme ($< 10$ or $> 90$) under low-ADX regimes ($\text{ADX} < 20$) yields positive net expectancy after deducting observed spreads and fees on purged walk-forward splits.

3. Required Technical Indicators

  • Bands: Bollinger(20, 2) on completed M5 closes (SMA 20 $\pm 2\sigma$).
  • Momentum: Wilder RSI(2) computed on completed M5 closes.
  • Regime & Costs: M5 ADX(14) and spread / ATR ratio.

4. Causal HTF Context & Trigger

  • HTF Context: Completed H1 ADX(14) must sit below 22 to verify a non-trending macro environment.
  • Alert: Bar t_alert closes below BB_Lower with RSI2 <= 10 (long) or above BB_Upper with RSI2 >= 90 (short).
  • Trigger: Bar t_trigger closes back inside the band (close > BB_Lower).
  • Execution: Filled at open[t_trigger+1] + half observed spread.

5. Exits & Trade Management

  • Stop Loss: Low(t_alert) - 1.0 * ATR_M5[t_trigger].
  • Take Profit: Middle band (SMA 20) or fixed 1.5:1 reward-to-risk ratio.
  • Time Stop: 12 bars (60 minutes).
  • Session Flatten: Unconditional exit at 15:58 ET (ETPs) or 23:50 UTC (Crypto).

6. Cost Filters & Execution Assumptions

  • Pre-Trade Gate: Stand aside if spread / ATR > 0.20 or cost / target > 0.12.
  • Path Resolution: If high and low hit stop and target on the same bar, assume adverse stop hit ohlcv.io on bar resolution.

7. Position Sizing & Risk Limits

  • Fixed-fractional sizing risking $0.50%$ of equity per trade based on the ATR stop distance M23.

8. Machine Learning Meta-Filter Extension

  • Role: Meta-filter predicting reversion success.
  • Features: Dislocation distance in ATR, RSI(2) value at alert, M5 ADX, spread / ATR, and rolling half-life estimate.
  • Model: Logistic Regression baseline vs. shallow XGBoost classifier.
  • Validation: Purged rolling walk-forward with 20-bar embargo.

9. Failure Modes & Rejection Criteria

  • Reject if net expectancy is negative after deducting observed spreads.
  • Reject if performance collapses under 90th-percentile spread stress.
  • Reject if estimated half-life is non-stationary ($\phi \ge 0$).

S2 — Session-VWAP Reversion (Delta Card)

1–4. Core Adjustments

5–9. Risk & Validation

  • Exits: Target is Session VWAP baseline; Stop is $3\sigma$ extreme or 1.0x ATR beyond breach low.
  • Warm-Up: No signals during the first 30 minutes of session open.

S3 — Prior-Day Level Sweep Rejection (Delta Card)

1–4. Core Adjustments

5–9. Risk & Validation

  • Exits: Target is Session VWAP or prior-day midpoint; Stop is $0.50 \times \text{ATR}$ beyond the sweep wick.
  • Range Filter: Block trades if prior-day range $< 0.60 \times \text{ATR}_{\text{Daily}}$ (dead tape).

Building It In Python

The executable script below demonstrates the complete S1 Bollinger/RSI Fade pipeline in Polars:

import polars as pl
import numpy as np

def run_bollinger_rsi_pipeline(
    df: pl.DataFrame,
    bb_window: int = 20,
    bb_dev: float = 2.0,
    max_adx: float = 22.0,
    stop_mult: float = 1.00,
) -> pl.DataFrame:
    """Execute causal S1 Bollinger/RSI fade logic with strict cost gating."""

    # 1. Compute Bollinger Bands & Wilder RSI(2)
    close = pl.col("close")
    sma = close.rolling_mean(bb_window)
    std = close.rolling_std(bb_window)

    delta = close.diff()
    gain = delta.clip(lower_bound=0).ewm_mean(alpha=0.5, adjust=False)
    loss = (-delta.clip(upper_bound=0)).ewm_mean(alpha=0.5, adjust=False)
    rsi2 = 100.0 - (100.0 / (1.0 + (gain / (loss + 1e-9))))

    # 2. Compute ATR(14)
    prev_close = close.shift(1)
    tr = pl.max_horizontal([
        pl.col("high") - pl.col("low"),
        (pl.col("high") - prev_close).abs(),
        (pl.col("low") - prev_close).abs(),
    ])
    atr14 = tr.ewm_mean(span=14, adjust=False)

    df = df.with_columns([
        sma.alias("bb_mid"),
        (sma + bb_dev * std).alias("bb_upper"),
        (sma - bb_dev * std).alias("bb_lower"),
        rsi2.alias("rsi_2"),
        atr14.alias("atr_14"),
    ])

    # 3. Apply Cost & Regime Gates
    df = df.with_columns([
        (pl.col("spread") / pl.col("atr_14")).alias("spread_to_atr"),
        (pl.col("spread") / (pl.col("bb_mid") - pl.col("close")).abs()).alias("cost_to_target"),
    ]).with_columns(
        (
            (pl.col("spread_to_atr") <= 0.20)
            & (pl.col("cost_to_target") <= 0.12)
        ).alias("gate_pass")
    )

    # 4. Generate 2-Step Alert and Trigger Signals
    df = df.with_columns([
        ((pl.col("close") < pl.col("bb_lower")) & (pl.col("rsi_2") <= 10.0)).alias("alert_long"),
        ((pl.col("close") > pl.col("bb_upper")) & (pl.col("rsi_2") >= 90.0)).alias("alert_short"),
    ]).with_columns([
        (
            pl.col("gate_pass")
            & pl.col("alert_long").shift(1)
            & (pl.col("close") > pl.col("bb_lower"))
        ).alias("signal_long")
    ])

    # 5. Model Next-Open Execution
    df = df.with_columns([
        (pl.col("open").shift(-1) + 0.5 * pl.col("spread").shift(-1)).alias("entry_price"),
        (pl.col("low").shift(1) - pl.col("atr_14") * stop_mult).alias("stop_price"),
        pl.col("bb_mid").alias("target_price"),
    ])

    return df

What This Means For Your P&L: Strategy Comparison Table

Metric S1 Bollinger / RSI Fade S2 Session-VWAP Reversion S3 Prior-Level Sweep Fade
Trade Frequency 2–4 trades / session 1–2 trades / session 0–1 trades / session
Spread Sensitivity High (frequent micro-turns) Moderate (clear VWAP target) Low (wide range targets)
Whipsaw Risk High in strong macro trends High if VWAP slopes steeply Low if volume confirms rejection
Primary Failure Mode Trend continuation expansions Persistent institutional flows Breakout and trend continuation
Recommended Action Deploy during low-ADX chop Deploy during rotational midday Deploy strictly at session open/levels

Testing It Honestly

Honest evaluation requires strict adherence to our causal validation protocol:

  1. Next-Open Fill Execution: Signal at close[t] $\rightarrow$ fill at open[t+1] Saral on next-bar-open execution.
  2. Conservative Intrabar Exits: Bars touching both stop and target are booked as losses (ambiguous_stop_first) ohlcv.io on bar resolution.
  3. Mandatory Purged Embargoes: Apply a 20-bar embargo between rolling folds to eliminate feature autocorrelation leakage.
  4. Stress Testing: Re-run all strategies under 90th-percentile spread curves.

Variants & Extensions

  • Keltner vs. Bollinger Envelopes: Evaluate ATR-based bands against standard deviation bands Volatility Box on Keltner vs Bollinger.
  • Ornstein-Uhlenbeck Time Stop Calibration: Dynamically adjust holding durations to $2 \times \text{Half-Life}$.
  • ML Meta-Label Filtering: Train shallow classifiers on dislocation depth and spread metrics to filter marginal entries.

Hands-On Project

Deliverable: Build docs/research/m11_mean_reversion_lab.md comparing S1, S2, and S3 across GLD and BTC perps.

Implementation Checklist

  • Implement S1, S2, and S3 in Polars using strict next-open execution.
  • Enforce pre-trade cost gates (spread/ATR <= 0.20, cost/target <= 0.12).
  • Run 5-fold purged walk-forward cross-validation.
  • Evaluate performance under baseline and p90 spread stress.
  • Perform half-life stationarity audits across all test splits.

Key Takeaways

  • Reversion is Liquidity Provision: You earn an edge by absorbing impatient flow, but you pay a double toll in spreads.
  • Two-Step Triggers Prevent Knife-Catching: Alert on extreme extension, trigger on confirmed close-back-inside.
  • Regime Filters are Non-Negotiable: VWAP slope and ADX gates protect capital from trending blowouts.
  • Flatten Hard Daily: Eliminate overnight carry and unmodeled funding decay before session close.

References

  1. SEC — Investor Bulletin: Exchange-Traded Fundshttps://www.sec.gov/investor/alerts/etfs.pdfMechanics. ETF market pricing, NAV drift, creation/redemption mechanisms.
  2. SSGA — SPDR Gold Shares (GLD)https://www.ssga.com/us/en/intermediary/etfs/spdr-gold-shares-gldMechanics. Physical gold trust structure and daily holdings.
  3. Pomegra — Commodity ETF Liquidity & Rollhttps://pomegra.io/learn/library/track-d-other-assets/commodities/chapter-09-commodity-etfs-and-etns/commodity-etf-liquidityMechanics. Futures pool roll mechanics and spread layers.
  4. Coinbase — Funding Rate Mechanismhttps://help.coinbase.com/en/derivatives/perpetual-style-futures/funding-rateMechanics. Perpetual funding schedules and spot tethering.
  5. Coinbase Learn — Understanding Funding Rateshttps://www.coinbase.com/learn/perpetual-futures/understanding-funding-rates-in-perpetual-futuresMechanics. Funding rates as an explicit carry friction.
  6. TOS Indicators — Hourly Volatility Models for ETFshttps://tosindicators.com/research/etf-volatility-modelsMechanics / Transfer. U-shaped intraday volatility curves.
  7. ContentWave — GLD Liquidity, Costs & Risks (2026)https://contentwave.net/article/review-spdr-gold-shares-gld-liquidity-costs-and-risks-2026Mechanics. Intraday ETP spread behavior and total ownership costs.
  8. Investopedia — Average True Range (ATR)https://www.investopedia.com/terms/a/atr.aspMechanics. Volatility yardstick for stops and cost gates.
  9. Liberated Stock Trader — 5 Mean Reversion Trading Strategieshttps://www.liberatedstocktrader.com/mean-reversion-trading-strategy/Transfer Evidence. Multi-indicator mean-reversion testing.
  10. TradingCompendium — Mean Reversion: RSI + Bollinger (2026)https://tradingcompendium.com/en/trading-strategies/mean-reversion-strategy-rsi-bollingerTransfer Evidence. Bollinger band and RSI(2) confluence mechanics.
  11. TradingPlan — Bollinger Band Mean Reversion Strategyhttps://www.tradingplan.io/strategies/bollinger-band-mean-reversion/Transfer Evidence. Close-back-inside triggers and ADX ranging filters.
  12. LearnCompareTrade — Intraday Mean Reversionhttps://learncomparetrade.com/resources/trading-strategies/day-trading/intraday-mean-reversion/Transfer Evidence. Intraday VWAP and Bollinger reversion principles.
  13. CryptoProfitCalc — Mean Reversion Crypto Strategy Guidehttps://cryptoprofitcalc.com/mean-reversion-crypto-strategy-the-complete-guide-indicators-entries-risk-backtesting/Transfer Evidence. Crypto intraday reversion risk controls.
  14. Xerogravity — Crypto Mean Reversion Strategy Guidehttps://xerogravity.com/blog/crypto-mean-reversion-strategyTransfer Evidence. Fee sensitivity and regime filter design.
  15. AlgoLab HK — VWAP Mean Reversion Trading Strategy Guidehttps://algolabhk.com/en/blogs/vwap-mean-reversion-tradingTransfer Evidence. Volume-weighted average price band calculations.
  16. VolatilityBox — VWAP Mean Reversion Strategieshttps://volatilitybox.com/docs/vwap-mean-reversion-strategies/Transfer Evidence. Session-anchored deviation bands.
  17. MomentumIQ — VWAP Mean Reversion (NSE)https://www.momentumiq.in/strategies/vwap-mean-reversionTransfer Evidence. VWAP slope filtering and risk controls.
  18. DayTradingToolkit — Prior-Day High and Low: Trading the Simplest Levelhttps://daytradingtoolkit.com/strategies/prior-day-high-low-breakout-strategyTransfer Evidence. Intraday liquidity sweeps at prior-session extremes.
  19. NetPicks — Previous Day High/Low Strategyhttps://www.netpicks.com/previous-day-high-low-strategy/Transfer Evidence. Sweep-versus-break confirmation rules.
  20. ohlcv.io — The Bar Resolution Problem (Pitfall 04)https://ohlcv.io/posts/backtesting-pitfalls/04-bar-resolution/Mechanics. Intrabar path ambiguity and adverse stop-first modeling.
  21. Saral Money — Next Bar Open Execution Timinghttps://saral.money/blog/next-bar-open-execution-timing/Mechanics. Eliminating same-close look-ahead bias in backtests.