Pair Trading Strategy Journal

Discussion in 'Journals' started by jonnysharp, Aug 18, 2008.

  1. 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
     
    #2521     Jun 4, 2011
  2. There is still the carry.
     
    #2522     Jun 4, 2011
  3. DBS67

    DBS67

    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.
     
    #2523     Jun 4, 2011
  4. 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...
     
    #2524     Jun 17, 2011
  5. sentrix

    sentrix

    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?
     
    #2525     Jun 18, 2011
  6. 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
     
    #2526     Jun 18, 2011
  7. 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....
     
    #2527     Jun 18, 2011
  8. 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.
     
    #2528     Jun 18, 2011
  9. 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?
     
    #2529     Jun 20, 2011
  10. NKNY

    NKNY

    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
     
    #2530     Jun 21, 2011