is the price of this tick equal to Open[0]? if not, what is the opening price of this (and not the previously finished) bar?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Open[0] with CalculateOnBarClose = true
Collapse
X
-
Open[0] with CalculateOnBarClose = true
the first tick of the bar just showed up. I presume this is when OnBarUpdate() gets called.
is the price of this tick equal to Open[0]? if not, what is the opening price of this (and not the previously finished) bar?Tags: None
-
Hello jalexan1,
Thanks for your post.
When using CalculateOnBarClose = true, the Open[0] would be the open of the latest finished bar and not of the currently forming bar. Your code would be unaware of the currently forming bar until it too closed and became the CurrentBar.
When using CalculateOnBarClose = false, the Open[0] would be the value of the first tick of the currently forming bar. In this case, CurrentBar is the currently forming bar.
When CalculateOnBarClose = true, you only get an OnBarUpdate event at the close of the bar, once per bar.
When CalculateOnBarClose = false, you will get an OnBarUpdate event on every tick (live data only, historical data is processed like CalculateOnBarClose = true).
Reference:
http://ninjatrader.com/support/helpG...onbarclose.htm
http://ninjatrader.com/support/helpG...currentbar.htm
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
52 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
142 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
160 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
96 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
276 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment