I am trying to understand consolidators. I've read through the consolidating data but I'm a bit confused as to why there are some differences in the logs of the attached backtest. The equity uses minute resolution to prevent stale data from options contracts. The indicators intended to use a daily resolution. Two consolidators are used, one with a daily resolution, the other with a timedelta(1). Each does a manual update of a simple moving average indicator and stores the last close price. An automatic SMA indicator is also used with daily resolution.
- Why do the daily values of the indicator and last close price from both consolidators not match?
- Why does only the consolidator with a timedelta(1) match the automatic indicator with daily resolution? I would expect that the daily resolution would be the one to match the automatic indicator.
A somewhat separate question, the backtest only does a single symbol, but when I add multiple symbols (with corresponding consolidators/plots) and run it over a 10 year period, it takes over 12 hours and times out. I know it is going through a lot of data points, but is there anything that can be done to make the code more efficient?
Appreciate any insight.
Derek Melchin
Hi Justin,
To use a Resolution argument when creating a TradeBarConsolidator, we need to call
For reference, see Time Period Consolidators.
This change will likely speed up the algorithm execution too. Before, OnDailyData was firing every 4 minutes in the backtest.
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.
Justin Chang
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!