I've been setting the date range of my backtests like the following:
def Initialize(self):
self.SetStartDate(2022, 11, 1) # Set Start Date
self.SetEndDate(2022, 11, 30) # Set End Date
which would run a backtest for the month of November 2022. I'm curious if there is a simple way to set the backtest date range to the month of November, without having to look up the specific end date of the month? For instance, if I try to set the end date as the 31st it gives an error (which, if it didn't give an error, I could just leave it like that for each month). I would like to do this as I usually run my backtests one month at a time for various reasons (in case a specific month gives an error the whole backtest won't be messed up, overcome the daily log limit, run backtests using two backtest nodes), and it's a bit annoying to have to look up the dates every time. Thanks.
George Riley
How about
make sure to include imports
Cheers
Dahui
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!