I've attached data from stock ABCD. The data should be imported using Format = NinjaTrader (beginning of bar timestamps), DataType = Last, Time Zone= Eastern Time (US and Canada).
I've pasted the most basic strategy below that just prints to the output screen the Time and current Close of the instrument:
namespace NinjaTrader.NinjaScript.Strategies { public class Test2: Strategy { protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Strategy here."; Name = "Test2"; Calculate = Calculate.OnBarClose; EntryHandling = EntryHandling.AllEntries; IsExitOnSessionCloseStrategy = true; } } protected override void OnBarUpdate() { Print(Time[0] + " " + Closes[0][0] ); } } }
Start Date: 08/01/2014
End Date: 08/05/2014
Trading Hours: Default 24/7
Break at EOD: yes
Then look at the last few lines of the output:
8/4/2014 3:43:00 PM 396.35
8/4/2014 3:44:00 PM 396.25
8/4/2014 3:45:00 PM 396.2
8/4/2014 3:46:00 PM 396.05
8/4/2014 3:47:00 PM 396.05
8/4/2014 3:48:00 PM 396
8/4/2014 3:49:00 PM 395.95
8/4/2014 3:51:00 PM 395.95
8/4/2014 3:52:00 PM 395.95
8/4/2014 3:53:00 PM 395.95
8/4/2014 3:54:00 PM 395.95
8/4/2014 3:55:00 PM 395.9
8/4/2014 3:56:00 PM 395.8
8/4/2014 3:57:00 PM 395.7
8/4/2014 3:58:00 PM 395.7
8/4/2014 3:59:00 PM 395.65
in State.SetDefaults
in State.Terminated
The strategy is not able to "see" the bar on 8/4/2014 4:00:00, which is 395.60. It thinks the end of the day is 3:59:00 PM even though I've set it for default 24/7.
Comment