Is there a way to code NinjaTrader to backtest only specific dates? I've been able to accomplish my goal, but in a very newbie way (see code below).
//Dates to be backtested
private DateTime date1 = new DateTime(2008, 7, 19);
private DateTime date2 = new DateTime(2008, 12, 19);
And on and on with the other dates...
//Entry condition
if (Time[0].Date == date1.Date)
EnterPosition();
if (Time[0].Date == date2.Date)
EnterPosition();
And on and on with the other dates...
Is there a more efficient way to do the same? I understand that I have to manually declare the dates, so that portion will probably not change. But the entry condition might be simplified in some way. I've tried to use string concatenation to change the "date1" variable to "date2" after the first date is executed, but without any luck.
As always, thank you all for your help.
Comment