Code. Models. Analysis. Decisions.

How to Write a Mean-reverting Trading Algorithm

Complete overview of training and testing a trading mean reverting algorithm. The first step in any automated trading strategy is to find a signal or signals that indicate when a trader should be entered. This video contains a discussion of identifying that algorithmic signal and testing the resulting profitability. While the signals vary the implementation of adding signals and testing is fairly constant, so while we may not identify the best strategy, you will be able to use the techniques discussed to test your own strategies quickly and easily. Discussion of drawbacks and limitations.

The idea behind mean reversion is that securities should not stray too far from their "mean". The question becomes what is the mean, and how far is too far away from it? There a re many answers to these questions nd the video tutorial will use one method andthen leave it up to you to refine and improve on the model we develop.

Get the notebook here.

Mean Reverting Trading Algorithm