Thanks for your note.
Since we are detecting if there is a new bar by using IsFirstTickOfBar and are accessing the previous value in myPrimarySeriesTickCounter, we could add a print that prints out the previous time (Time[1]).
For example, if we add a print for Time[1] and we run the script on a 1-Minute chart, we could see a print that looks something like this
myPrimarySeriesTickCounter[1] count is 207 Time: 3/6/2023 2:58:00 PM
Period is 207
myPrimarySeriesTickCounter[1] count is 102 Time: 3/6/2023 2:59:00 PM
Period is 102
The 2:58 PM candle will hold the number of ticks that occurred from 2:57 to 2:58 when the script is run on a 1-Minute chart. We see a print output of 207 for the count of myPrimarySeriesTickCounter[1]. This means that there were 207 ticks that occurred from 2:57 PM to 2:58 PM.
We can see there is a count of 102 from 2:58 PM to 2:59 PM in the prints above.
Time: https://ninjatrader.com/support/help...eries_time.htm
Please let me know if I may assist further.


Comment