Pairs Trading Backtest

Statistical arbitrage strategy backtesting with automatic pair discovery and mean reversion trading

Cointegration
Mean Reversion
Statistical Arbitrage

Backtest Configuration

Set up your pairs trading strategy parameters

Loads symbols and core config from strategies saved in Backtest Engine.

Tip: Use stocks from the same sector for better cointegration

Run a backtest to see results

About Pairs Trading

How It Works

  • Identifies cointegrated pairs using statistical tests
  • Calculates spread between pairs using hedge ratio
  • Enters positions when spread diverges (high z-score)
  • Exits positions when spread converges (low z-score)
  • Assumes mean reversion of the spread

Best Practices

  • Use stocks from same sector for better cointegration
  • Monitor cointegration p-values regularly
  • Set stop-losses for diverging spreads
  • Test multiple parameter combinations