Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pairs trader with Hurst, ADF, and Half life tests feedback.

Attached is my current revision of a pairs trading algorithm that uses the following tests to test whether a pair is cointegrated:
-Augmented Dickey–Fuller (ADF) unit root test to see if the spread is stationary/mean reverting
-Hurst exponent to see if the spread is also stationary/mean reverting
-Half life to see whether the pair will revert back to the mean in a relatively short period of time

And uses a softmax function to create orders.

I was looking to see what you think. One thing I know I need to do is bring that beta down if I do want to be able to start entering competitions.

3 responses

this is the backtest the contest will see. 10M and 2 years

Feedback:
first you need to see if you can figure out how to make it trade right away instead of 6 months of warming up. then, Beta is the last thing you need to worry about, You should get your drawdown WAY down, like <5%, Leverage is out of control too, on the 2nd or 3rd day of trading you had -6M in cash, that will bust your algorithm right away, if you go over 1.0 leverage you will be disqualified. Next if you manage to get those down you should see how your sharpe is, 1.0 will not even be close.

Hi Luke,
Cool thanks! I'll definitely look into bringing down those metrics. I still got to figure out exactly I'll do it, but if modifying my pairs tests doesn't work, I'll likely fall back on the account object for looking at my leverage for example and various other options.

To help identify pairs - I use this site, however its only for intra-day trading. They have hurst as well. https://raveanalytics.com/