@ringtail One thing you can try is to check the length once you run the backtest and log it to terminal. This way you only fail once and can run the next test with the appropriate adjustements to start date.

Another thing I do to assist with this problem is to have a start date for data and a start date for trading. I make the room between these two more than enough for whatever strategy I'm running.

Start date for data is the one you are already using. Start date for trading you just put a check at the beginning of next and return if the start date is not met.