Skip to content
All library documents

Optimizing Minimum-Profit Bounds for Cointegration Pair Trading

Code Stratmill research code

Summary

This module describes a method for selecting upper and lower trading thresholds for a mean-reverting cointegration pair. It estimates a hedge ratio using either Engle–Granger or Johansen analysis, constructs the cointegration error as the spread, and fits an AR(1) process to that series. The optimization then uses mean first-passage time calculations to choose a bound intended to maximize minimum trade profit over a stated trading horizon. A Gaussian kernel and numerical integration grid support the passage-time calculation, while a helper derives trade levels and integer share counts.

The method assumes the spread is cointegrated and approximately follows an AR(1) process; the documentation stresses that cointegration is crucial. It warns that the numerical procedure can be computationally intensive. The excerpt does not include the complete optimization implementation or any empirical results, and its thresholds depend on fitted parameters and discretization choices. Consequently, the code describes a model-based parameter-selection approach, not evidence of profitability or a guarantee that the assumptions will hold out of sample.

Key ideas

  • The method fits a hedge ratio with Engle–Granger or Johansen cointegration analysis.
  • It models the resulting spread as an AR(1) process and estimates mean first-passage times.
  • The optimization selects bounds intended to maximize minimum trade profit over a trading horizon.
  • The approach depends on cointegration and AR(1) assumptions and may require substantial computation.
  • The excerpt provides no empirical performance results.

Tags

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