CalculateOnBarClose = false;
...
if (FirstTickOfBar) {
Print("First tick of bar, at time " + Time[0] + ", at close " + Close[0]);
} else {
Print("At time " + Time[0] + ", at close " + Close[0]);
}
I'm replaying the day, tick-by-tick, and my output looks like:
At time 6/27/2017 10:20:00 AM, at close 2428.75
At time 6/27/2017 10:20:00 AM, at close 2428.75
At time 6/27/2017 10:16:03 AM, at close 2428.75
At time 6/27/2017 10:16:03 AM, at close 2428.75
At time 6/27/2017 10:20:00 AM, at close 2428.75
At time 6/27/2017 10:20:00 AM, at close 2428.75
At time 6/27/2017 10:16:04 AM, at close 2428.75
At time 6/27/2017 10:16:04 AM, at close 2428.75
At time 6/27/2017 10:20:00 AM, at close 2429
At time 6/27/2017 10:20:00 AM, at close 2429
At time 6/27/2017 10:16:04 AM, at close 2429
At time 6/27/2017 10:16:04 AM, at close 2429
At time 6/27/2017 10:20:00 AM, at close 2429
At time 6/27/2017 10:20:00 AM, at close 2429
At time 6/27/2017 10:16:05 AM, at close 2429
At time 6/27/2017 10:16:05 AM, at close 2429
At time 6/27/2017 10:20:00 AM, at close 2428.75
At time 6/27/2017 10:20:00 AM, at close 2428.75
At time 6/27/2017 10:16:06 AM, at close 2428.75
At time 6/27/2017 10:16:06 AM, at close 2428.75
I'm replaying on the ES, on a 4 minute bar, but I always get this situation. I don't understand why the times are out of sequence? Since I'm replaying by the second, I would think I would see the printed time increase by one second at a time, with the current price. That is, I'd think the output would be like:
At time 6/27/2017 10:20:01 AM, at close 2428.75
At time 6/27/2017 10:20:02 AM, at close 2428.75
At time 6/27/2017 10:20:03 AM, at close 2428.75
At time 6/27/2017 10:20:04 AM, at close 2429.00
Your thoughts? Thanks.
Comment