Stochastic Methods Workflow

The Stochastic Methods tab is the model-driven cousin of Mean Reversion. Instead of tuning a threshold on an RSI, you fit a continuous-time model to the price series — Ornstein–Uhlenbeck, Kalman filter, Hurst, HMM — and trade when the model says the current state is extreme relative to its equilibrium. It is the tab we recommend for users who've backtested indicator rules and want a more statistically disciplined alternative.

What lives in this tab

One module, Stochastic Calculus Builder (SC001STCB), that hosts several methods:

  • OU Z-Score (single-asset) — Fits an Ornstein–Uhlenbeck process to log-price. You trade when the z-score relative to the OU mean exceeds a threshold and exit when it reverts. The fit gives you a half-life — the expected time to revert — which doubles as a sanity check on whether OU is the right model for the series.
  • OU Pairs / Kalman Pairs — Same idea applied to a hedged pair. OU uses a static hedge ratio; Kalman updates the hedge ratio dynamically. Pairs Scanner on the same page produces candidate pairs ranked by correlation, cointegration, OU half-life and β stability.
  • MR Scanner — Ranks tickers by Hurst → OU half-life → ADF → KPSS to surface candidates that are statistically mean-reverting before you commit to a backtest.
  • HMM regimes — Hidden Markov Model to classify market states; usable as a filter on top of the OU/Kalman trade signal.
  • Grid Search + Walk-Forward — The two validation tools that matter most. Grid Search sweeps the parameter plane and shows a robustness surface; Walk-Forward runs multiple sequential IS/OOS windows and produces a verdict score, composite OOS equity and decay ratio.

Canonical workflow

  1. Find a candidate. Single-asset users: run MR Scanner against your index — shortlist tickers that pass Hurst and have an OU half-life roughly in the range you want to trade (e.g. 10–60 bars). Pairs users: run Pairs Scanner on a basket and shortlist pairs with high correlation, cointegration, reasonable half-life and stable hedge ratio.
  2. Configure the method. Pick OU Z-Score or Kalman Pairs, set the entry/exit z-thresholds, pick a lookback window for the parameter estimates, set direction, stops.
  3. Run a single backtest to confirm the setup produces a reasonable trade count and equity curve.
  4. Grid Search. Sweep two parameters (e.g. entry z-threshold and exit z-threshold, or half-life window and z-threshold). The output is a robustness surface. A robust strategy looks like a wide plateau on this surface — if the best point is a narrow spike surrounded by bad neighbours, you've found an overfit.
  5. Walk-Forward. Click the → Walk-Forward button (now opens in a new tab so the backtest stays put). It imports your grid-search robust zone, locks the swept parameters to zone centres, and then runs multi-fold walk-forward by sweeping different parameters. This is the anti-overfitting validation — you're testing that the robust-zone choice holds up on pure OOS data across multiple windows.
  6. Read the verdict. Walk-Forward returns a verdict score (0–100), composite OOS equity curve, per-fold parameter stability and a decay ratio (how much IS performance survives to OOS). A verdict score in the 60s+ on a composite OOS curve that looks like the IS curve is what you want.
  7. Save the config. It lands in the Execution ribbon. Forward-test in Stochastic Paper Trading (PT005STPT).
Why this tab exists

Indicator rules are fast to build but easy to overfit, because you can always add another filter until the backtest looks good. Stochastic methods are slower to set up but harder to overfit — the model's parameters have statistical meaning (half-life, hedge ratio, state probability), and the Grid Search + Walk-Forward combination is built specifically to distinguish real edge from parameter luck.

Reading the outputs

  • OU half-life — If the estimated half-life is either very short (1–2 bars) or longer than your holding horizon, OU is probably the wrong model for this series.
  • Grid Search robustness surface — Look for a wide plateau, not a peak. The reported "robust zone" is the rectangle of parameters where behaviour is consistent.
  • Walk-Forward verdict — The composite score reflects OOS-only performance across folds. Pay attention to the decay ratio too — a ratio close to 1.0 means IS performance translates to OOS; a ratio much below 0.5 is the smoke signal for overfitting.
  • Per-fold parameter stability — If the optimal parameters jump around wildly between folds, the strategy is fitting noise even if the composite curve looks OK.

Common pitfalls

Watch for
  • Skipping the scanner. Running OU on a non-mean-reverting series produces nonsense parameters. The MR Scanner / Pairs Scanner step is not optional.
  • Walk-Forward on too few folds. 3 folds is not validation; 8+ folds is. If your history is too short, expand the lookback or accept the result is weaker.
  • Judging by the single backtest. A clean single backtest means nothing here — Grid Search + Walk-Forward are the judgment tools, not the headline backtest.

Deeper reading

  • Trading Strategies → Mean Reversion Overview, Hurst Exponent, Half-Life, Variance Ratio — the math underneath MR Scanner and OU.
  • Trading Strategies → Market Regime Detection for HMM and regime-aware filtering.
Back to QuanterLab
Report
Loading report...
Article
Loading article...