Back

Pairs Trading with Coke & Pepsi

Hello, 
I created a basic trading strategy designed to play upon the historically high correlation of two stocks to maximize return. The basic premise of the strategy is to bet on the convergence between the two stocks when the spread in prices is high.

The strategy utilizes a long term Relative Performance Index, which calculates the price of one stock over the other over a given time period. Then, a daily Relative Performance Index is created, and if this Index hits two Standard Deviations above or below the mean RP, you long the undervalued stock and short the overvalued stock, expecting prices to return back to equilibrium in the near future. 

This was my first attempt at a trading strategy, so if anyone has any suggestions, I would be happy to hear them!

Update Backtest








For More reading on the strategy:

http://quantpedia.com/screener/details/12

http://www.investopedia.com/university/guide-pairs-trading/pairs-trade-example.asp
0

Pretty interesting results with Visa and Mastercard:

0


Beware the implementation is heavily long biased, because the code is brittle (and possibly incorrect w.r.t author's intention, but I'm not sure). Mastercard has nearly increased 10-fold in value since 2008, which reflects in the algo results; you will suffer from selection bias this way.

A better way to implement the orginal algo would be to compute target signals (as 0, 1 or -1 per stock) and then calculate order quantities as a separate step to match targets - that way it becomes clearer what's happening.

Attached a backtest with a bit more statistics added to Relative Performance chart to illustrate this (sorry for clutter, mouseover values).

0


Might be an interesting target for alpha framework implementation.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


whats the idea behind the target signals? or how something like that could be calculated? any ideas?

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed