[R-SIG-Finance] Pairs trading & cointegration

Mark Knecht markknecht at gmail.com
Tue Feb 23 03:38:48 CET 2010


On Mon, Feb 22, 2010 at 6:31 PM, Brian Giarrocco
<chrysanthemum at gmail.com> wrote:
> First time posting here so I hope I get it right!
>
> I'm an undergraduate in an American University, and am Computer
> Science/Math/Finance focused. I'm attempting to create a basic Pairs Trading
> portfolio as a project and have found many good resources online that have
> pointed me in the right direction.
>
> I have a symbol list of 50 Utility stocks w/ 500k+ ADV. I then compare each
> symbol to every other symbol using the Dickey-Fuller test, and then accept a
> pair if it passes with 95% confidence. Pretty simple idea.
>
> I created a python script to back-test different entry and exit points, but
> the problem, as most of you may have already found -- is that the
> co-integration does not significantly hold. The profitability seems to be
> around 1-2% over a year period. (Profitable, but not good)
>
> I'm looking to expand this out, does anyone have any suggestions on what I
> can add to tighten up the confidence of the cointegration. Is it possible to
> add in fundamentals? Are there any good papers that deal with cointegration
> between equities (Specifically in the US Equities Market)?
>
> I've posted all my code to: http://g-rock.dreamhosters.com/pairs/
> With the hope that it may help someone in the future.
>
>
> Thanks for any tips,
> Brian Giarrocco
> bvgiarro at edisto.cofc.edu

A fairly typical answer I suspect but have you investigated using some
overall gate to tell you to favor long or short, such as ETF for the
utility sector or overall market direction using the SPX or something
else like that?

pairs.r did not resolve for me.

Cheers,
Mark



More information about the R-SIG-Finance mailing list