I've recently started with algorithmic trading, helping some forex friends of mine to code their successful strategy.
I began by recreating the strategy in a research notebook, making sure to feed the market data into the algorithm with a loop, to prevent the possibility of look-forward bias, and I calculated the profit or loss of each trade by subtracting the closing price at the trade exit by the closing price of the entry.
After optimization we were quite happy with how reliable and profitable the strategy was, and we ended up testing it in the research notebook over 200,000+ bars.
The next step was to then rewrite it in the backtesting environment using the Lean engine, and even after meticulously double checking that they were essentially identical, the results differed between the two.
If you can give me more insight as to what I might be failing to take in to account, or what I might be missing, I'd greatly appreciate it. Thanks.
Louis Szeto
Hi Jean_Pierre_Snyman
There could be a lot of reasons even if you've already controlled the look-ahead bias. The below are some of the most common ones IMHO:
Hope the above insight would help you refine you strategy. 😊
Best
Louis
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.
Jean_Pierre_Snyman
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!