Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OnBarUpdate question.
Collapse
X
-
Hello Conceptzx,
Thank you for your post.
Yes, you can separate logic in OnBarUpdate to calculate either on bar close or on every tick/price change using IsFirstTickOfBar. This property indicates if the incoming tick is the first tick of a new bar. When IsFirstTickOfBar is true, this means the previous bar closed and a new bar is forming.
IsFirstTickOfBar - https://ninjatrader.com/support/help...ttickofbar.htm
This sample script also demonstrates separating logic to either calculate once on bar close or on every tick:
Please let us know if you have any further questions.
- Likes 1
-
Hello Conceptzx,
I am not aware of a way to do this with OnPriceChange and OnEachTick. From the Help Guide:
"OnPriceChange means once for each price change. If there were two ticks in a row with the same price, the second tick would not trigger OnBarUpdate()."
Some ticks will be ignored when using Calculate.OnPriceChange.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
52 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
29 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
194 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
355 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
274 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment