Optimal Trading Bands

The standard Z-score bands at ±2 are heuristic — they work, but there is no theoretical reason they are optimal. For OU-modelled spreads, Bertram (2010) derived closed-form expressions for the entry and exit thresholds that maximize expected return per unit time, given transaction costs. This article unpacks what "optimal" means and when to use the analytic solution vs. an empirical sweep.

The Optimization Problem

For an OU spread with parameters (θ, μ, σ) and a round-trip transaction cost c, the trader chooses entry threshold a and exit threshold b. Each round trip:

  • Earns gross profit = (a − b) × σ_eq.
  • Costs c.
  • Takes expected time = E[T(a, b; θ)], the OU first-passage-time integral.

The objective: maximize (net profit per trade) / (expected time per trade) — i.e., expected return per unit time. This balances larger trades (wider thresholds) against trade frequency (narrower thresholds).

The Intuition

Wide entry thresholds wait for big deviations — large per-trade profit, but rare opportunities. Narrow thresholds trade often, but each trade is small and gets eaten by costs. The optimum balances them. Bertram's closed-form solution gives you the exact balance, parameterized by the OU half-life and the cost ratio c / σ_eq.

The Bertram Solution (Sketch)

For a "trade-when-spread-exceeds-a, exit-at-mean" strategy, the optimal entry threshold satisfies:

a* = argmax_a [a × σ_eq − c] / E[T(a; θ)]

where E[T(a; θ)] is the expected first-passage time from 0 to a in the OU process. The integral is well-known and tabulated; numerical solutions are fast.

The closed-form optimal threshold scales with:

  • The cost-to-noise ratio c / σ_eq — higher costs push the optimum to wider thresholds.
  • The mean-reversion speed θ — faster reversion allows narrower thresholds (you don't need to wait for big deviations because they revert quickly).

When to Use the Analytic Solution

  • Clean OU spread. Pairs trades and Z-scored single names that pass stationarity tests fit the OU assumption well; the analytic optimum is meaningful.
  • Transaction-cost-dominated. When costs are a meaningful fraction of typical edge, the optimal threshold significantly differs from heuristic ±2 levels. The analytic solution helps.
  • Capacity-constrained. When trade frequency itself matters (e.g., for capacity reasons), optimizing return-per-time is more relevant than optimizing per-trade Sharpe.

When the Analytic Solution Fails

  • Non-OU dynamics. Real spreads have non-Gaussian innovations, time-varying parameters, regime changes. The analytic solution is exact for OU; it's an approximation for everything else.
  • Asymmetric exits. Bertram's formulation assumes exit at mean. Asymmetric strategies (enter at -2, exit at +0.5) need different machinery.
  • Stop-losses. The closed form ignores stops. Adding a stop materially changes the optimization problem; numerical methods or empirical sweeps are needed.
  • Parameter uncertainty. The "optimal" threshold for the estimated (θ, σ) may not be optimal for the true (θ, σ). Robustness testing is essential.

Leung-Li Extensions

Leung and Li (2015) extend Bertram's framework to include explicit transaction costs and a stop-loss exit. Their solution gives entry, take-profit, and stop-loss thresholds jointly. More realistic than Bertram for real trading, more complex to compute, and still requires the OU assumption.

The Practical Recommendation

Use the analytic optimum as a starting point, then run an empirical robustness sweep around it. Two checks:

  1. Does the empirical sweep show a plateau near the analytic optimum? If yes, the OU model is fitting the data well and the analytic solution is meaningful.
  2. Does the analytic optimum sit on or near the plateau? If the analytic optimum is in a low-Sharpe valley while a separate plateau exists at very different thresholds, the data has structure the OU model misses — use the empirical plateau, not the analytic optimum.

QuanterLab's Implementation

SC001STCB exposes both: the analytic Bertram optimum (computed from the fitted OU parameters and your specified cost) and the empirical robustness surface from a threshold grid search. Compare the two; trust the empirical plateau when they disagree.

The Bottom Line

Optimal trading bands are the right answer when the OU model is the right model. In clean, well-fitting OU spreads with meaningful transaction costs, the analytic optimum significantly outperforms heuristic ±2 thresholds. In messy real data, use it as a sanity check on your empirical sweep, not as a substitute for it.

Further Reading

Foundational papers

  • Bertram, W. K. (2010). Analytic Solutions for Optimal Statistical Arbitrage Trading. Physica A, 389(11), 2234–2243.
  • Leung, T. & Li, X. (2015). Optimal Mean Reversion Trading with Transaction Costs and Stop-Loss Exit. International Journal of Theoretical and Applied Finance, 18(3).
  • Avellaneda, M. & Lee, J.-H. (2010). Statistical Arbitrage in the U.S. Equities Market. Quantitative Finance, 10(7), 761–782.

Textbook references

  • Chan, E. P. (2013). Algorithmic Trading: Winning Strategies and Their Rationale. Wiley.
  • López de Prado, M. (2018). Advances in Financial Machine Learning. Wiley.

Related QuanterLab articles

Try it in QuanterLab

After fitting OU on a spread in SC001STCB, compare the analytic Bertram-optimal threshold to the empirical robustness sweep maximum. They should be close; if they're very different, the OU model is not capturing the true dynamics — trust the empirical sweep.

Back to QuanterLab
Report
Loading report...
Article
Loading article...