Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Augmented Dickey-Fuller test - useful?

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

2 responses

A good overview to stat arb (which is a new field to me, I'm not an expert) I think is this paper(s)

http://www.hughchristensen.co.uk/PaperDepository/papers/thesis/Burgess%20PhD%20Thesis%20-%20A%20Computational%20Methodology%20for%20Modelling%20the%20Dynamics%20of%20Statistical%20Arbitrage.pdf

search for dickey-fuller and he talks about its strengths and weaknesses and alternatives.

//Cheers

Thanks...Grant