I have an interesting behaviour of ninjatrader. It is placing in the backtest and optimization trades outside the chart - I think shifted by a few hours.
I am not sure if the test is invalid or just the chart display is wrong.
My setup is: my local time zone is currently UTC +1 (Berlin) my Timezone set in Ninjatrader is UTC-5 Eastern Time (New York).
Same behaviour is when I shift the local time zone to UTC-5.
Does anybody know if my test is valid anyway?
Below you can see a plausible case based on my timezone, and an unplausible case based on the NY time zone.
The EA restricts by time as follows:
DateTime start1 = Time[0].Date;
start1 = start1.AddHours((int)InpHourFrom).AddMinutes((InpH ourFrom - (int)InpHourFrom) * 60);
DateTime end1 = Time[0].Date;
end1 = end1.AddHours((int)InpHourTo).AddMinutes((InpHourT o - (int)InpHourTo) * 60);
// Prüfe, ob der aktuelle Balken nach die Uhrzeiteinschränkung einhält
if (ToTime(Time[0]) < ToTime(start1)) {
return; // Verlasse die Methode, wenn es vor inpHourFrom Uhr ist
}
if (ToTime(Time[0]) >ToTime(end1))
{
if (Position.Quantity != 0)
{
ExitLong();
ExitShort();
}
return; // Verlasse die Methode, wenn es nach inpHourTo Uhr ist
}
Plausible case:
Time Zone in Ninja set to my timezone
Best trade
Unplausible case Time Zone set to NY time (Ninjatrader was restarted to take effect)
Result
Best trade - position completely outside the bars - it is just exemplary, most of the positions are outside the bar
My questions are:
do I have to think about the wrong display as false backtest result or is it just a display issue?
Can I rely that Time[0] is in the timezone I set in the Ninjatrader settings?
Thanks and best regards

Comment