This is my very first post. So, I would like to start this blog sharing with you this project about Statistical Arbitrage (original – EPAT).
The objective of this project is to model a statistical arbitrage trading strategy and quantitatively analyze the modeling results. Given the phenomenon that some stocks, generally in the same sector, move in tandem because prices are affected by the same market events and the noise might make them temporarily deviate from the usual pattern, traders can take advantage of this apparent deviation with the expectation that the stocks will eventually return to their long-term relationship.
Trading Strategy Idea
Correlation analysis is performed for all possible pairs to filter out those which have suitable properties for executing statistical arbitrage. The logic of the strategy is: for any correlated pair when pair ratio diverges from a certain threshold, we short the expensive stock and buy the cheap one. Once they converge to the mean, we close the position and profit from the reversal.
The strategy triggers new orders whenever the pair ratio from two stock prices diverges from the mean. To ensure the convenience of trading, the time series (pair ratio) must be cointegrated. If so, the ratio is said to be mean reverting and the greater the dispersion from its mean, the higher the probability of a reversal, which makes the trade more attractive. This analysis allows in determining the stability of the long-term relationship. Spread time series is tested for stationarity by the Augmented Dickey-Fuller (ADF) test. In other words, if pair stocks are cointegrated, it suggests that the mean and variance of this correlation remains constant over time.
There is, however, a major issue which makes this simple strategy difficult to implement in practice: long-term relationships can break down, and the spread can move from one equilibrium to another.
You can read the complete project work of the author including the Python codes for Pairs Trading by downloading the EPAT-Project-by-Jonathan-Moreno-Narv-ez-on-Pair-Trading. Highlights from the project include:
- Pair Trading – Statistical Arbitrage on Cash Stocks
- Code Details and In-Sample Backtesting
- Analyzing Model Output
- Monte Carlo Analysis and much more…