Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.72 KB

File metadata and controls

62 lines (45 loc) · 2.72 KB

Pair trading and statistical arbitrage module

Goal

Build a separately validated market-neutral sleeve from stable economic relationships. Pair trading is not activated merely because two stocks are correlated or react differently to news.

How it is designed

  1. pair_selection.py screens liquid candidates.
  2. cointegration.py tests whether a spread is statistically mean reverting.
  3. spread_signals.py creates rolling hedge ratios and entry/exit Z-scores.
  4. pair_portfolio.py constructs dollar- and beta-aware long/short positions.
  5. Event controls should pause or invalidate a pair when company-specific information may cause a permanent relationship break.

Positive co-movement plus cointegration is the primary mean-reversion path. Negative correlation belongs to hedge research and is not, by itself, evidence of a tradable pair.

Current achievement

The final 250-name development universe contained 31,125 finite pairwise relationships:

  • 900 pairs with absolute correlation below 0.10.
  • 126 negatively correlated pairs.
  • 455 pairs with absolute correlation at least 0.70.
  • Median correlation: 0.357.

This disproved the earlier impression that the broad universe contained no diverse relationships. The point-in-time v5 experiment then applied cointegration stability, crossing, half-life, liquidity, execution-cost, and placebo controls. It selected 2.81 pairs per formation on average. The sleeve earned only 0.04% annualized on total capital, with a 95% incremental-return interval of -0.19% to +0.27%. Timing passed its circular-shift placebo (p=0.0099), but pair identity failed the random same-sector control (p=0.218).

Activation status

Disabled. The pair experiment passed five of seven gates but failed the positive confidence bound and random-pair tests. Adding it moved frozen-core CAGR from 12.19% to only 12.23%. It cannot be added to the reported portfolio to repair a failed directional confirmation.

Limitations and next work

  • Replace the constant borrow and spread assumptions with security-level historical observations.
  • Acquire reliable structural-event scope labels before testing event-based pair pauses.
  • Separate sector-relative pairs from broad factor co-movement.
  • Do not retune the failed v5 rules on the already observed development period.

Main commands

python -m src.cli analyze-correlation-universe --help
python -m src.cli select-pairs --help
python -m src.cli run-pair-trading-v5 --help

Related documentation