Hello all,
I am experimenting with pairs trading(stat arb) and need help. Specifically, I am looking for a way to get the ratios for each leg of a stock using as little work as possible. See below for an example of how I calculate a spread.
AAL/LUV spread:
I use google sheets and the google finance function to grab 30 days of the stock closing price for both AAL and LUV. I then use the average function to find the average price of those 30 days for both those stocks. So the 30 day average is: AAL=40.59
LUV=36.99
I then find the ratios by dividing the larger price by the smaller so:
AAL/LUV=40.59/36.99=
1.16
Thus my spread would be = AAL-LUV*
1.16
Now that is a lot of steps to do for over 1000 pairs. Does anyone have an idea on how to condense this process? Currently, I am working in Google Sheets using the Google finance function. I would only be interested in the coefficient that balances the spread(i.e. 1.16 in the example above). Any help would be much appreciated.
See the google doc sheet I am working in:
https://docs.google.com/spreadsheet/ccc?key=0AlfPgsyN3k0TdE9lYXlNaWRYX09BUXdTaEJvZ1lKdEE&usp=sharing