Skip to content
All library documents

Exponential Ornstein–Uhlenbeck Entry, Exit, and Switching Levels

Code Stratmill research code

Summary

This document describes a class for applying an exponential Ornstein–Uhlenbeck model to mean-reverting portfolio prices. It inherits fitting and portfolio construction from an OU model, then works in log-price space to estimate optimal liquidation levels, entry intervals, and switching levels. Inputs include discount rates, transaction costs, a training period, and an optional stop loss. The code also supports process simulation and plots of the calculated trading levels against portfolio prices.

The method uses value functions and numerical optimization: a minimization routine checks whether an optimal entry solution exists, while root-finding solves equations for liquidation and entry thresholds. The excerpt gives implementation details but no empirical results or performance evaluation. Its thresholds depend on fitted model parameters and chosen costs and discount rates; the truncated code does not expose the full switching algorithm or establish that the model is reliable out of sample. The output should therefore be read as model-based decision levels, not evidence of a profitable strategy.

Key ideas

  • The model represents positive portfolio prices by exponentiating an Ornstein–Uhlenbeck process in log-price space.
  • Optimal liquidation and entry levels are obtained by solving equations based on discounted value functions.
  • Discount rates and transaction costs are inputs to the entry, exit, and switching decisions.
  • A numerical optimization check tests whether the required optimal entry solution exists.
  • The provided excerpt contains no empirical validation of the resulting trading levels.

Tags

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