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 CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
163 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
82 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
125 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
206 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
184 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment