📈 Interactive Pairs Trading Backtester

(Using TradingMRI API - Inbuilt Dates)

Analyze potential statistical arbitrage opportunities between two assets.

Pairs Trading Explained

Pairs trading is a market-neutral strategy that aims to profit from temporary mispricings between two related assets (a "pair").

Core Idea:

How This Backtester Works:

Important Limitations:

Parameters

Using default key. Get your own from TradingMRI for more data.

Note: API provides max 120 days.

Note: API provides max 120 days.

Window for calculating spread mean/std dev.

Enter trade when |Z-Score| >= this value.

Exit trade when |Z-Score| <= this value.

Results

Disclaimer: Data fetching uses the TradingMRI API (api.tradingmri.com) which limits free requests to 120 data points. Cointegration test is simplified (Z-Score based). Backtest excludes transaction costs/slippage. For educational use only.