Pair Trading Strategy Journal

Quote from DBS67:


I looked at your examples since 2001, 2007 and 2009 using the Engle-Granger method. Only KFY/RHI passes on the residuals test since 2001 at 99% confidence. That is to say, the residuals are stationary and therefore the series is cointegrated.

KFY/RHI also passes at 95% since 2007; and displays a valid mean reversion alpha number (just) over that range.

I attach a pic of the residuals for the pair since 2007. The other details to go along with that:

r2=79%
alpha=-.96
beta=1.17
half life=2.64

Hope this helps. [/B]

Nice work. What software are you using to generate these results? Also, is there a time-based input into the co-integration metric? I have asked Jared at PTF about this but have not gotten any response yet.

Thanks!

Kevin
 
Quote from Kevin_in_GA:

Nice work. What software are you using to generate these results? Also, is there a time-based input into the co-integration metric?
Thanks!

Kevin

Thanks, Kevin.

This is a non-commercial piece of custom coding.

But it's not really the software that matters as much as getting the math & stat right. If that's sound it can be set-up in a bunch of different platforms.

That said, in my view the ergonomics of producing scans, running millions (literally) of iterations very quickly, filtering out the trash, scoping the output etc will end up pointing beyond VBA, matlab and so on (for example and assuming you actually have a life you'd like to enjoy).

Subjective stuff but please drop me a private message if you are interested in those details.

The 'time-based' input you mention, if I'm understanding you right, is simply the number of observations the cointegration process has to crunch. For example, that data I gave for KFY/RHI was since 2007. Since 2001 the same outputs read:

r2=0.7
alpha=-1.15
beta=1.21
Half-life=2.21

(and cointegration is valid at both 99% and 95%).

Hope this answers well enough.
 
Quote from DBS67:

@amitkumar,

What time range are you using for those 3 pairs?

I cannot say how the single PTF number is calculated. But a cointegration analysis usually produces more output.

I looked at your examples since 2001, 2007 and 2009 using the Engle-Granger method. Only KFY/RHI passes on the residuals test since 2001 at 99% confidence. That is to say, the residuals are stationary and therefore the series is cointegrated.

KFY/RHI also passes at 95% since 2007; and displays a valid mean reversion alpha number (just) over that range.

I attach a pic of the residuals for the pair since 2007. The other details to go along with that:

r2=79%
alpha=-.96
beta=1.17
half life=2.64

Hope this helps.

So at the minimum we know this stuff is useless. I am now in this trade for over a month and there is no end in sight,,,,both stocks are going in the wrong direction. at least not have to worry about getting your technique...
 
Hi,

I downloaded the trial version of PTF few days ago, to backtest my pair trading strategy. But as I wanted to create a new group of stocks, I got an error message. I tried to create a group, which was ok, but as I tried to add the codes I got the error message in the window below.
I have installed Microsoft SQL and Microsoft NET framework before.
Does anybody know, how to solve this problem?
 
Some further thinking on PTF:

Having used the new version for about 6 weeks, I am pretty satisfied. Several things need some work for the next upgrade, though:

1. The ability to add either correlation or cointegration metrics into the trade signals (e.g., only trigger a signal when the delta is greater than 2 AND the cointegration is above, say 0.95).

2. Not sure how (or if) PTF corrects for stock splits. In the backtesting data you often see a one-day big dislocation from a 2:1 split that triggers a phantom signal. The backtests treat these as real when calculating performance, and perhaps of more concern is that they impact the SD and mean for the ratio going forward for some time. This creates error-prone signals going forward as well if not corrected.

Does anyone have insights on this second point?

Kevin
 
Quote from Kevin_in_GA:

Some further thinking on PTF:

Having used the new version for about 6 weeks, I am pretty satisfied. Several things need some work for the next upgrade, though:

1. The ability to add either correlation or cointegration metrics into the trade signals (e.g., only trigger a signal when the delta is greater than 2 AND the cointegration is above, say 0.95).

2. Not sure how (or if) PTF corrects for stock splits. In the backtesting data you often see a one-day big dislocation from a 2:1 split that triggers a phantom signal. The backtests treat these as real when calculating performance, and perhaps of more concern is that they impact the SD and mean for the ratio going forward for some time. This creates error-prone signals going forward as well if not corrected.

Does anyone have insights on this second point?

Kevin

I have been tinkering with it. Here is what I don't understand ( like as in ignorant), how come cointegtration breaks down so quickly on some pairs. Isn't co-integration a more sturdy long term measure ?


In an earlier post I mentioned three pairs I got in. They were more than 95% coint. they are still in loss....
 
Quote from amitkumar_ny:

I have been tinkering with it. Here is what I don't understand ( like as in ignorant), how come cointegtration breaks down so quickly on some pairs. Isn't co-integration a more sturdy long term measure ?


In an earlier post I mentioned three pairs I got in. They were more than 95% coint. they are still in loss....

Not really sure - cointegration clearly is time frame dependent, but is still somewhat of a black box to me as well. I plan to take a small set of stocks and look at varying the settings in PTF to better understand what inputs are used in their calculation of cointegration.

As to why your specific trades are not playing out as expected, I can only guess that either 1) a cointegration of 0.99 might be required to justify using cointegration at all, or 2) you are the victim of statistics this time around, rather than the benefector.

No disrespect intended - I am all too often on the losing side of what statisitically should be a slam dunk. That's why I neither love nor hate statisitcs, but simply respect it.
 
OK, interesting update.

I talked with Jared and asked him specifically about the time frame over which PTF determines the co-integration between a pair. He indicated that it is "based on the total period of data for the stocks."

That got me thinking ... does that mean that if I were to look at a single pair and get data for 1,2,3,4 ... 10 years, each time period saved as a separate backtest, that the co-integration would change?

I used ESRX:MDT (a pair that showed 0.99 co-integration over a 10 year period) and created separate backtest data as described above. Here are the results:

1 year co-integration: 0.34
2 year co-integration: 0.62
3 year co-integration: 0.54
5 year co-integration: 0.76
7 year co-integration: 0.98
10 year co-integration: 0.99

Raises an interesting question ... is it better to rely on long-term co-integration behavior, or short-term? My gut is telling me that short-term co-integration is what will be more important given the duration of most pair trades.

Thoughts?
 
Quote from amitkumar_ny:

I don't know. I am in three trades with more than 0.95 co-integration and classic heartbeat chart..and they are all going in the wrong direction

-HAL / +OII
-KFY / +RHI
-SWM / +WPP

Hi Luxor and Amitkumar... What std and moving averages are you guys using.? I'm using a 2,5 std with co integration over 90. In the backtest I usually choose pairs with a nice equity graph, >75% wins and average wins larger then average loses. So far have had three winning closed trades but still have a bunch that are open. Put on like three more trades yesterday.

Oh btw, I'm using the new default settings except I changed the std from 2.7 to 2.5 and I also look for at least 200 day extremes but prefer 365 day... I'll know more in about a month I guess on how my performance will be with cointegration as its too soon to know now but it does look promising...

Nick
 
Back
Top