Hi everybody!
I'm an absolute beginner whith quant research, trying to back up my discretionary ideas with solid numbers. I find QuantConnect an incredible opportunity, even tough I'm still wrapping my head around the API...
My question is quite simple: How do I plot an indicator (Keltner Channel in this particular case) making sure is not taking into account the latest price in the calculation, but only the bar before now?
Specially in the research enviroment, where there are no "on data" events.
If The indicator is plotted on the close of historical data, and it includes on the calculation the "right now" bar close before we would actually be able to use it in live trading, this would represent a giant look ahead bias.
How do I make sure is processing lagged data? (With Python)
I hope I made the question clear enough, thanks already for reading my newbie ramblings :)
Arthur Asenheimer
Hi Maria,
welcome to the quant community.
This is a very good question, especially for a beginner. :-)
For the backtesting environment, you should know that the backtesting engine LEAN is designed as an event-driven system. The emitted data is controlled by the time frontier to prevent/mitigate look-ahead bias.
To your question regarding the research environment: there is no built-in mechanism for the purpose of preventing look-ahead bias in research environment. Of course you could develop some plausibility checks but it would fail its essential purpose in my opinion.
Instead, I recommend to do your research with watchful eyes and when transfering your work to production, make sure your backtest results are in line with your findings from research.
Derek Melchin
Hi Maria,
To plot indicators in the research environment, refer to our documentation here.
Best,
Derek Melchin
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.
MariaChiara Barbaro
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!