Using Heat Potentials to Optimize OU Trading Thresholds
Summary
The code implements a heat-potential method for choosing profit-taking and stop-loss boundaries for a profit-and-loss process modeled as Ornstein–Uhlenbeck mean reversion. Given the model parameters, a time-step density, and a maximum holding duration, it rescales the inputs and constructs numerical grids and integral helper functions. It solves Volterra equations to obtain terms used in a Sharpe-ratio calculation, then numerically searches for the pair of thresholds that maximizes that ratio, subject to a positive take-profit and negative stop level.
The output includes the optimized thresholds converted back to the original scale, the maximum Sharpe estimate, and the allowed trade duration. This is a model-based optimization procedure rather than a complete trading system: its results depend on the OU assumptions, parameter estimates, grid resolution, duration choice, and numerical optimizer. The supplied excerpt is incomplete, and it offers no empirical validation, execution modeling, or evidence that optimized thresholds retain their performance out of sample.
Key ideas
- The method assumes trading P/L follows an Ornstein–Uhlenbeck process.
- It uses heat-potential calculations and numerical Volterra-equation solutions to evaluate candidate boundaries.
- A numerical optimizer selects take-profit and stop-loss levels to maximize a modeled Sharpe ratio.
- The thresholds are scaled back to the original units, while parameter estimation and real-world validation remain outside the implementation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.