Hi,
After reading E. Chan's Algorithmic Trading and also reading the Kalman Filter post I wanted to try to replicate the EWA/EWC trade from 2006 to 2012. For reference, here's one whose returns are similar to Chan's. Unfortunately, I've been having a very hard time replicating the returns of Chan here on Quantconnect. If you simply swap the tickers and time range to EWA/EWC and 4/26/2006-4/9/2012 you get a disappointing result (attached). However, the most interesting thing is that the pricing of EWA/EWC is much different than the data says.
Looking on Yahoo and QC's own data (EWC, EWA), the prices are much higher than what are traded at in the backtest (clone and run or look at the trade download here). The backtest prices are ~$11 and $18 vs ~$22 and $25.
Any ideas to interpret this? Am I looking at this wrong? Does this have anything to do with it?
https://www.quantconnect.com/data/file/equity/usa/minute/ewa/20060426_trade.zip/20060426_ewa_minute_trade.csv
Shile Wen
Hi James,
To get closer to the returns in the Quantopian post, we would need to set the fees to zero, which we can do by creating and setting a custom fee model with zero trading costs. We also need to remove the AlphaBrokerageModel, which has fees. However, since we account for the effects of spreads with our L1 data, the returns will not be exactly the same.To get the order prices more similar to the ones seen in the data library and Yahoo Finance, we would need to set the data normalization mode to raw. I’ve shown these changes in the attached backtest. Remember to set the security initializer before any Add Security function calls so that the effects are applied.
Best,
Shile Wen
James Kerns
Hi Shile,
Thanks so much! The custom initializer is something I didn't know about. I realize a $0 fee model isn't realistic but it allows me/us to replicate other (fee-free) algorithms to at least know I've programmed the logic correctly. At that point I would then revert to an actual broker model.
Thanks!
James Kerns
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!