I want to be able to set a time frame for my back test.
When running my strategy live, my code for allowing the user to define the start and end times is working fine:
if ((DateTime.Now > StartTime) && (DateTime.Now < EndTime)){//make money}
How would you recommend I change this 'if' statement so I could backtest my strategy as running only in the morning, for example. Or similarly, to be able to run aa backtest outside of the hours I am defining within the strategy?
Thanks
Comment