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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
155 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
90 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
137 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
130 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment