Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Time Stamp not correct on Bars
Collapse
X
-
Time Stamp not correct on Bars
Hi guys, I am testing my strategy real-time and when I print time[o] it shows me a time that is 1 hour before the current time, even though the close[0] data is correct. I am running the strategy on 60 minute bars (also 1 hour before on other bars like 120 minute). Any idea why this is doing this? I am using a print statement in the output window to show me the time.Tags: None
-
-
Hi Sir, yes it does calculate right, now it seems to be continuously calculating the close for the 60 minute bar as 1:30PM eastern time. What next?
Comment
-
Hello elitetradernyc,
Great, the reason why you are seeing the values being 1 hour late is because NinjaTrader is going to be calculating only once at the close of each bar. So to be able to get real-time updates you would have to keep CalculateOnBarClose (COBC) set to false but NinjaTrade will calculate your NinjaScript on each incoming tick of data. Using COBC set to true you will have to wait till the bar closes to be able to see the hour pass.
Note that you can use the FirstTickOfBar as a condition if you would like to keep COBC set to false and only have it print once per bar.
JCNinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
113 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
60 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
40 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
43 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
81 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment