TL;DR
The paper introduces KBPT (KalmanNet-aided Bollinger bands Pairs Trading), a hybrid model-based/data-driven algorithm that enhances traditional pairs trading. By embedding a neural-augmented Kalman Filter (KalmanNet) into a partial co-integration state-space model and using a differentiable Bollinger Bands policy, KBPT overcomes real-world model mismatches and non-Gaussian noise to maximize trading revenue while maintaining low latency and interpretability.
What Problem Does This Paper Address?
Pairs trading is a popular quantitative strategy that exploits the statistical relationship between two historically correlated assets. When the price spread between them widens abnormally, a trader shorts the overvalued asset and longs the undervalued one, betting that the spread will eventually revert to its mean.
Traditionally, this is modeled using a linear State-Space (SS) model, where a Kalman Filter (KF) tracks the hidden relationship (like the hedge ratio and the mean spread), and Bollinger Bands (BB) dictate the buy/sell triggers based on standard deviations from the moving average.
However, classic Kalman filtering relies on two fragile assumptions:
- The underlying system model is perfectly accurate.
- The noise in the financial market is Gaussian.
In reality, financial markets are chaotic, heavy-tailed (non-Gaussian), and plagued by model mismatches. While pure deep learning or Reinforcement Learning (RL) methods can bypass these assumptions, they act as uninterpretable "black boxes," require massive amounts of data, and introduce high computational latency—a fatal flaw for high-frequency trading. This paper bridges the gap by combining the structural domain knowledge of state-space models with the adaptive power of deep learning.
Methods
The authors propose KBPT, which integrates three core components into a single trainable pipeline:
- An Extended State-Space Model: Unlike traditional models that assume a static relationship, the authors formulate a new Partial Co-Integration (PCI) state-space model that accounts for a time-varying hedge ratio and models the spread as an autoregressive process.
- KalmanNet Tracking: Instead of using a standard KF, KBPT utilizes KalmanNet—a hybrid architecture that retains the standard Kalman Filter equations but replaces the complex, noise-dependent calculation of the Kalman Gain with a dedicated Recurrent Neural Network (RNN). This allows the system to learn market stochastics directly from data without assuming Gaussian noise.
- Differentiable Bollinger Bands Policy: Standard Bollinger Bands rely on step functions (hard thresholds) to open or close positions, which cannot be differentiated for gradient descent. The authors replace these with a smooth, differentiable surrogate function (a Gaussian cumulative distribution function), allowing the entire system to be trained end-to-end.
The Two-Stage Training Procedure
Training a model without ground-truth financial indicators is notoriously difficult. KBPT solves this with a two-stage approach:
- Stage 1 (Task-Ignorant Pretraining): The KalmanNet RNN is trained in an unsupervised manner to minimize the mean-squared error (MSE) of the predicted next observation, stabilizing the filter.
- Stage 2 (End-to-End Optimization): The entire pipeline is tuned simultaneously to directly maximize the cumulative Profit and Loss (PNL) reward using gradient descent.
Datasets
The authors evaluated KBPT using daily opening prices spanning multiple years from Yahoo Finance across four distinct asset pairs known to exhibit co-integration properties:
- CHF - EURO (Foreign Exchange)
- AUD - ZAR (Foreign Exchange)
- EWC - EWA (Period A) (iShares Canada ETF vs. iShares Australia ETF)
- EWC - EWA (Period B) (Same ETF pair over a different historical timeframe)
Each dataset was split into an in-sample training set (2,000 pairs) and an out-of-sample testing set (944 to 1,500 pairs).
Key Insights and Ideas
- Trading Optimization $\neq$ Tracking Optimization: The most striking finding is that optimizing a filter strictly for tracking accuracy (Stage 1) actually results in worse trading performance. When shifted to PNL optimization (Stage 2), the tracking MSE degrades, but the financial returns skyrocket. The network learns to extract a surrogate feature optimized for decision-making rather than literal physical tracking.
- Hedge Ratio Dynamics: By allowing the hedge ratio to vary dynamically over time within the state-space model, the hybrid architecture captures transient market shocks far better than static co-integration models.
- Efficiency Over Frequency: Data-driven RL models often over-trade, racking up massive transaction fees. KBPT learns a highly conservative policy, executing significantly fewer trades than benchmarks while generating higher total returns.
Key Results
KBPT was compared against standard model-based filters (KF-CI, KF-PCI) and a deep reinforcement learning benchmark (Double Deep Q-Network, or DDQN).
- Higher PNL: On the CHF-EURO pair, KBPT achieved a final PNL of 1.77 USD compared to the standard model-based baseline of 0.129 USD.
- Massive Annual Returns: For the AUD-ZAR pair, KBPT delivered an annual return of 218.8%, vastly outperforming the standard KF (26.9%) and the RL-based DDQN (26.4%).
- Fewer Trades: In the EWC-EWA (Period A) test, the DDQN executed 1,071 trades to achieve a 25.9% annual return. KBPT executed only 275 trades but achieved a staggering 141.6% annual return, proving its superior efficiency.
Limitations and Future Work
While KBPT naturally minimizes trades, the mathematical formulation does not explicitly penalize transaction costs (friction) within its loss function. The authors note that adding a explicit transaction penalty term to the Stage 2 loss function is a vital next step.
Additionally, the current model is strictly designed for pairs trading (two assets). Extending this neural-augmented architecture to multi-asset portfolios (statistical arbitrage baskets) and adapting it to high-frequency, sub-second trading environments remain open areas for future research.
Summary updated