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!
Bryan Wang
Ruslan
Pretty interesting results with Visa and Mastercard:
Petter Hansson
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).
Jared Broad
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.
Michael Manus
whats the idea behind the target signals? or how something like that could be calculated? any ideas?
Bryan Wang
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!