This project explores the application of Monte Carlo simulations in a Lévy-driven mean-reverting framework for pairs trading. We use synthetic data to demonstrate the methodology and backtest a trading strategy.
The synthetic data is generated to represent two assets with a mean-reverting spread. The spread is modeled using the Ornstein-Uhlenbeck process.
- Synthetic data is generated using the
data_generation.py
script. - The spread between the two assets is modeled using an Ornstein-Uhlenbeck process.
- The Ornstein-Uhlenbeck process is calibrated to the synthetic spread data using the
model_calibration.py
script.
- Potential future paths for the spread are simulated using the calibrated Ornstein-Uhlenbeck process.
- Simulations are performed using the
monte_carlo_simulation.py
script.
- A pairs trading strategy is backtested on the synthetic data using thresholds determined from the Monte Carlo simulations.
- Backtesting is performed using the
backtesting.py
script.
The project demonstrates how to use Monte Carlo simulations in a mean-reverting framework for pairs trading. The strategy shows positive returns on the synthetic data, but it's essential to consider real-world factors and risks when applying to actual trading scenarios.
- Generate synthetic data using
data_generation.py
. - Calibrate the model using
model_calibration.py
. - Run Monte Carlo simulations using
monte_carlo_simulation.py
. - Backtest the strategy using
backtesting.py
.
For questions, feedback, or contributions, please open an issue or submit a pull request.