Sunday 11 July 2010

Pair Trade Analyser

Around 3-4 months ago I wrote a platform to facilitate the style of pairs trading that I've adopted. Just yesterday I stripped it down to release a small sample of what it can do but even in this form it's still quite a useful little tool.


This program gets daily data from the Google finance. Credit to the libraries used is given in the About of the application.


This little demo only grabs a year of daily data from Google, whereas the full version has a flexible time horizon over which to perform the analysis. The full version also allows for batch analysis of each possible permutation of a group of stocks pairing them up, as well as automated trading with intra-day analysis using the interactive brokers api.


Download Link




4 comments:

  1. Hi Nate,

    thanks for a very informative blog. I have been comparing some of my calculations with the output of the Pair Trade Analyser demo and not getting the same results. What is confusing me is how you derive the ratio of the two stocks' prices. Simply dividing one price by the other does not give me the ratio you get. Then I noticed that you also use a residual value of beta, but I am not sure how this value is calculated. Could you please clarify the calculation of the ratio? Many thanks.

    Andre

    ReplyDelete
  2. An absolutely excellent question. I was asked this at a presentation at the end of UBC's math finance programme.

    I'll take some time to summarise my response in a blog post since I want to ensure the mathematics is clear, along with finding the appropriate citations.

    ReplyDelete
  3. Thanks Nate, it will be good to get to the bottom of how the ratio and other components of the system are derived.

    ReplyDelete
  4. how to get he software?

    ReplyDelete