Mean-Reversion Trading Strategy Using the Ornstein-Uhlenbeck Process

This project explores a mean-reversion trading strategy based on the Ornstein-Uhlenbeck process, a model often used for financial time series that revert to a long-term mean. The notebook begins by importing necessary libraries and simulating historical price data. It then defines a function to estimate the Ornstein-Uhlenbeck process parameters (long-term mean, speed of mean reversion, and volatility) using a maximum likelihood estimation (MLE) approach. After estimating the parameters, the notebook calculates a long-term mean price and generates buy and sell signals based on a threshold of one standard deviation from the mean. Finally, it visualizes the price data with the calculated mean and the generated buy and sell signals plotted on the chart.

This project demonstrates a mean-reversion trading strategy using a simulated Ornstein-Uhlenbeck process, including parameter estimation and the generation of buy and sell signals.