View Full Version : Start time
maninjapan
05-29-2008, 01:11 AM
I am trying to use the start and finish time function when running my strategies however it seems that even if I set the start time more than 30 minutes from the current time the strategy still starts straight away. Has anyone else had this problem? I have downloaded the latest version of 6.5 (v3).
NinjaTrader_Dierk
05-29-2008, 01:27 AM
Not sure I follow. You can not set session start/end time programmatically but only by the properties dialog.
NinjaTrader_Josh
05-29-2008, 01:28 AM
Maybe this reference sample can be of some use: http://www.ninjatrader-support.com/vb/showthread.php?t=3226
maninjapan
05-29-2008, 02:11 AM
Sorry, I may not have explained myself properly. In the properties section you can set the start and finish time, correct? even if I set it to start later than the current time by any amount the strategy enters orders as soon as I press start and not waiting until the actual time I entered to start.
NinjaTrader_Dierk
05-29-2008, 02:18 AM
Correct, the strategy will start after session start.
maninjapan
05-29-2008, 02:34 AM
I am trying to test a strategy and it seems to be ignoring the start time and starting immediately, regardless of how late I set the start time (and I am setting it in local time)
NinjaTrader_Dierk
05-29-2008, 02:36 AM
Not sure I follow. Please make sure there is data to backtest and debug your strategy as per here: http://www.ninjatrader-support.com/vb/showthread.php?t=3418
maninjapan
05-29-2008, 02:39 AM
the strategy works fine. Here is an example.
The current time is 5pm. I set it to start at 19:00. As soon as I press start though it begins trading immediately, even though it is before 19:00.
NinjaTrader_Dierk
05-29-2008, 02:42 AM
Please make sure you familiar with the "Historical" concept (search docs for "Historical").
To avoid that your strategy trades on historical data add this to your OnBarUpdate method:
if (Historical)
return;