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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
131 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
73 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment