Pairs trading seems to be a topic of interest recently on Quantopian. Does anyone have experience with cointegration tests, such as the augmented Dickey-Fuller test?
I've attached an example for:
context.stocks = [sid(8347), sid(23112)] # XOM & CVX
For this pair, the ADF test is not passed consistently at the 1% level, but it does pass for some 30 minute periods. For example, on 7/15:
2013-07-15PRINT2013-07-15 13:50:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 13:53:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 13:54:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 13:55:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 13:56:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 13:57:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 13:58:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 13:59:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 15:12:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 16:40:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 16:41:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 17:27:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 17:47:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 17:48:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 17:49:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 17:50:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 19:27:00+00:00 ADF test passed
2013-07-15PRINT2013-07-15 19:34:00+00:00 ADF test passed
Is this type of test (or a better one) normally part of a pairs trading algorithm, to ensure that the pair will likely revert?
Grant