Pairs Trading Strategy Model

Discussion in 'Strategy Building' started by Neutral_Al, Sep 5, 2002.

  1. Homer

    Homer

    Al,
    lmt/nly correlated at 86%??!! Does that site give you return correlation or price correlation??? There is a big difference. The CECO/APOL is a better example though. I have run across this pair before but have never traded it. What time frame are you using to determine your entry/exit/stop prices?? I'm assuming your technical levels were for the ceco/apol spread, but i'm not seeing what you are seeing. I like a - 1.6 entry point (short) or buy the spread around - 2.6. Of course I am not looking to hold onto the position for two weeks though. Thanks for the info on the web site, I think I'll take another look at it.
    Good Luck
    Homer
     
    #171     Dec 9, 2002
  2. Does anyone know if TradeStation is capable of naming a pair of stocks as a single stock? In other words, if I have a universe of highly correlated (or negatively correlated) pairs, I want to scan the PAIRS for certain criteria....the same way anyone else would scan single securities for certain criteria.

    If anyone can offer any suggestions, I would greatly appreciate it.

    Thanks
    PT
     
    #172     Dec 9, 2002
  3. First, Tradestation 6 doesn't have scanning capabilites. The pair would have to be in an open workspace, with an alert set. Practical for 50 pairs or less. TS 2000i has a workspace scanner and can scan across a large list of symbols. TS promises this scanning capability will return in V7 (don't bet the farm on it).

    Secondly, if you setup both stocks on the same chart you can then program most any sort of indicator off them, using data1 and data2 as input. You can then apply most types of TA to the pair indicator, however, you cannot "buy and sell" the indicator. You can't buy and sell the pair either, just the first dataset. This is a big "gotcha" for pair trading.

    I've gotten around this limitation by programming an indicator to simulate the buying and selling of the pair and reporting the results to an output window or file.

    Also, you can't import data into TS (yet).

    Hope this helps.
     
    #173     Dec 9, 2002
  4. bone

    bone

    I don't quite understand the point you're trying to make. Please elaborate. I leg into and out of pairs many times per week based upon technical indicators.
     
    #174     Dec 9, 2002
  5. man

    man

    I agree with homer that correlation on price means something very different than correlation on returns (=logarithmic yields).

    LMT - NLY highly correlate on price but do not on return.
    Looking at a simple chart of prices, they indeed look as if they walked together after early/mid 2000. Nevertheless, current 250 day correlation is 0.21 on yields and 0.71 on price.

    Normal analysis would not take that pair into account, since usually correlations are not calculated on price.
     
    #175     Dec 10, 2002
  6. I apologize for not reading all postings of this thread, so I might have informed you already. For those long threads it would be good to have a “search the thread” function. Anyway, here are a couple of scripts (systems) that do what you might be looking for, I am not posting the code, since you can take a look at it when clicking the link but I add the description of the publishers so that you know which might be of interest for you. You can also test some of them after clicking the link::

    1. From the article "Pair Trade II System" from the Trading System Lab section of the February 2002 issue of Active Trader. This script always uses Microsoft as the second symbol of the Pair Trade. You can modify the script to use a different symbol. http://www.wealth-lab.com/cgi-bin/WealthLab.DLL/editsystem?id=14030

    2. This is from S&C March 2001 issue.
    Pairs Trading is a very interesting strategy because it is "market neutral". That means it should perform equally well in bull or bear markets. Two closely correlated stocks are chosen. Whenever there is a strong deviation from their "should-be" ratio, one is bought and the other sold short, hoping that they will soon come back to their "normal" ratio. Additional information and a complete explanation of the strategy can be found in the S&C article by Stéphane Reverre.
    To use this script, you must create a watchlist which contains the symbols SC and RD.
    The results are certainly not spectacular, but this strategy produces a steady stream of income and shows exceptionally low drawdowns. Example $imulator result: RD/SC pair, 2000 bars, 50 % of capital for each trade (i.e. 50 % SC AND 50 % RD), one way commissions 2 $.
    The 103 % profit in 8 years is about 9.5 % a year, but the exposure is only 20 %, so we could try to find some additional pairs to approach 100 % exposure and obtain a reasonable income from this strategy.
    To get this strategy to produce money, it is essential to chose a broker with low commissions. We should pay no more than 1 or 2 $ commissions for a 5000 $ position. Example: 5000 $ is about 123 shares of RD (as of 02/08/2002, closing price = 40.54 $), commissions 1 Cent/share = 1.23 $. http://www.wealth-lab.com/cgi-bin/WealthLab.DLL/editsystem?id=6655

    3. This is an enhanced version of the original "Pairs Trading" script (the one above). It avoids unnecessary trades by providing exit thresholds. It now uses market orders to make it convenient to trade.
    Thanks to jrbyrd's contribution, you can now click on any symbol in a watchlist, and it choses the best correlated symbol automatically. The correlation coefficient is displayed in a small text pane below the price pane, so that you can see if the chosen pair is appropriate for pairs trading.
    This script is vulnerable to bad data quality. There should be no missing/double bars in your data, otherwise you will see a shift between the two trades of a pair trade (different entry/exit dates for the two symbols). If you're not sure about the quality of your data, you can disable "Strict Synchronization Check" in Tools/Options/System to avoid error messages. "Reverse Synchronization" must be enabled.
    If you want to further explore the correlations between the stocks in your watchlists, see discussion thread "Correlation Analyser" (on the WL site).PS: The script doesn't work on the web site, for WLD owners only! http://www.wealth-lab.com/cgi-bin/WealthLab.DLL/editsystem?id=6990

    I hope you find some valuable information in the various systems. Programming pairs systems is surely aimed more for the advanced user then for beginners, but the description might give you some idea. All example above are not my work. The credit belongs to the nice people who were kind enough to share their programming work and ideas with the trading community. Most of all what you will find is the possibility to add empirical evidence on some of the assumptions or a base for furhter studies.

    Volker
     
    #176     Dec 10, 2002
  7. man,

    What's wrong with calculating correlation on price? How calculating correlation on yields gives you better prediction?

    Al
     
    #177     Dec 10, 2002
  8. man

    man

    Neutral AI
    in most cases it will not be too bad. but when there are extraordinary large moves the picture and the interpretation will change.
    I include a graph of FNM FRE, correlated at about 0.9. So roughly speaking in the same category of correlation claimed for LMT-NLY. I feel that even looking at the chart only one can see significant more similiarity. 0.8 or 0.9 are very high corrleations, thus the stocks move almost always parallel.

    Actually I do not care too much about discussions on methodology. if correlation on price works for you, fine, don't change.

    peace
     
    #178     Dec 11, 2002
  9. Vishnu

    Vishnu

    a. Volker, those scripts are great and people should definitely check them out. I use modifications of them for all my pair trades.

    b. don't get so obsessed with correlations between similar stocks. Those correlations are old news by definition. If you really want to make "nickels" trading pairs than look for equities that are LEGALLY linked to correlate and then observe the correlation between their historical volatilities.
     
    #179     Dec 11, 2002
  10. man

    man

    Vishnu
    what do you mean by legally linked? I find the idea of correlating volatilities a very good approach. Sounds very reasonable to me.

    peace
     
    #180     Dec 11, 2002