Skip to content
All library documents

Calibrating Profit Targets and Stops with a Synthetic Ornstein–Uhlenbeck Model

Article MQL5 articles

Summary

This article proposes deriving triple-barrier profit-taking and stop-loss levels from a fitted discrete Ornstein–Uhlenbeck process rather than selecting the best pair from a historical grid search. It explains how the autoregressive coefficient describes reversion speed, how that relates to half-life, and how residual volatility and a chosen forecast shape simulated post-entry paths. The forecast distinguishes a zero-centered mean-reversion case from more directional cases based on post-cost average P&L or average winning trade.

The procedure estimates process parameters from cost-adjusted trade outcomes, generates synthetic paths, and applies an optimal trading rule to compare barrier combinations. A risk ceiling constrains the stop dimension, while forecasts guide the profit target. Shared random shocks make comparisons across candidate barriers less noisy, and a Numba implementation makes large simulations practical. The article gives illustrative parameter values and explains why pip and return units yield equivalent barriers after conversion. Its estimates remain dependent on the quality and stability of the input P&L model, broker cost assumptions, forecast choice, and risk constraints; synthetic calibration does not demonstrate future profitability.

Key ideas

  • Historical optimization of stop and target pairs can select rules that fit sample-specific noise.
  • A discrete Ornstein–Uhlenbeck model represents P&L moving toward a chosen forecast under random shocks.
  • The forecast determines whether the modeled strategy is mean-reverting or directional, while the autoregressive coefficient controls convergence speed.
  • Post-cost P&L should be used to estimate the process and directional forecasts.
  • Risk limits cap stop-loss candidates, and common random shocks improve comparisons across simulated barrier pairs.
  • Barrier values scale between pip and return units when converted consistently.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.