Minimum-Profit Bounds for Cointegrated Pairs Trading
Summary
This implementation describes a threshold-based rule for a cointegrated pair. It opens a long-spread trade when the spread falls to or below a lower entry level, or a short-spread trade when it rises to or above an upper entry level. A trade closes when the spread reaches the designated exit level from the relevant side. The rule permits only one active trade at a time and records trade metadata such as entry spread, side, timestamp, and an identifier.
The approach is attributed to research on protecting pairs trades with minimum-profit bounds. The document provides code behavior rather than empirical results: it does not specify how to estimate cointegration, derive optimal thresholds, size the legs, or account for execution costs. The class accepts share quantities, but the shown signal and trade-update methods do not themselves demonstrate order execution or use those quantities to calculate returns. Its results therefore depend on external threshold estimation and trading infrastructure.
Key ideas
- A long spread is entered when the spread falls to a lower threshold, while a short spread is entered at an upper threshold.
- Trades exit when the spread reaches the configured closing level for the position direction.
- The rule tracks open and closed trades and allows only one active trade at a time.
- The implementation does not explain threshold estimation, execution, transaction costs, or return calculation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.