Hi,
I'm new to Quant Connect and new to coding as well. I've been trying to essentially create a “gap” scanner for which I can then run code on securities that meet the criteria. however I'm finding my algorithm to take about 5 minutes to backtest on just one month of data, this is making it hard to repeatedly run iterations as I debug and build, and also makes me worried how long the backtest will take once it is applied to a much longer time frame and actually buys and sells.
One month backtest gave 22Million data point so I'm guessing the slowness is primarily due to the amount of data, But thought there may be a way to make the filtering more efficient? or maybe I'm doing something silly with my code that's slowing it down, I've also heard c# is much faster, is it worth switching?
Louis Szeto
Hi Ben
The initial warm-up is computationally expensive and will take some time for a large coarse universe, but shall be taking much less time afterward. This could be improved by a more powerful backtesting node (e.g.B4-12/B8-16). We also suggest using scheduled events rather than OnData loop as (1) it saves more time, and (2) OnData will never have a 9:00 slice since the market is not open. Please check the attached backtest.
Best
Louis Szeto
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.
Ben456
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!