i have been trying to finish a strategy for quite a long time but im unable because for some reason NinjaTrader stops working, closes itself and is impossible to reopen unless you reinstall it. The code is finished except the datetimes. when i try to insert the datetime to finish the code, the code compiles correctly but when i click "strategy" after the right click on the chart, what i wrote previously happens and when i try to reopen NinjaTrader i get the error on the image and it stops working again (i can open it again only after deleting the strategy from the NinjaTrader 8 folder in documents folder and reinstalling NinjaTrader . Any idea why?
i have tried defining 2 datetimes both as private and public, but i still get the same error.
Apparently these is the only lines that create the error:
DateFrom = DateTime.Parse("05/05/2017 4:10:00 PM");
DateTo = DateTime.Parse("05/05/2017 4:15:00 PM");
or this, defining them before "protected override void OnStateChange()"
private DateTime DateFrom = DateTime.Parse("05/05/2017 4:10:00 PM");
private DateTime DateTo = DateTime.Parse("05/05/2017 4:15:00 PM");
im not very good at coding so there's probably something wrong but i have no idea what it is.
kind regards
Comment