Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
currentbar resets
Collapse
X
-
currentbar resets
I am new to developing an indicator and am trying to the currentbar value within my onbarupdate method. I notice though that it goes well beyond 1000 but when I get to a realtime state it ends up being in the lower hundreds, around 200. Why does that happen?Tags: None
-
Hello hansob3,
Thanks for opening the thread.
I am not sure how you are testing to see the behavior you are describing. CurrentBar will start at 0 for the first historical bar and will continue increment even after the script has transitioned into realtime bars. I have attached a video explaining the behavior: https://www.screencast.com/t/IezPWUzQZvE
Historical bars will always calculate with Calculate.OnBarClose unless Tick Replay is enabled on the Data Series and the NinjaScript is set to Calculate.OnEachTick. Realtime bars will calculate either on bar closed or with each tick depending only on the Calculate setting.
I'd like you to take the same steps I have in my video to see the behavior.
Calculate - https://ninjatrader.com/support/help...?calculate.htm
CurrentBar - https://ninjatrader.com/support/help...currentbar.htm
If you have any questions, please don't hesitate to ask.
-
Hello hansob3,
I would not expect the data to output that way.
I may suggest an Instrument Reset.
- First, disconnect from any data providers by navigating to the Control Center > Connections menu, and left-click on “disconnect” that appears to the right when hovering your mouse over any active connection
- Next, reset your instruments by navigating to the Control Center > Tools > Database Management
- In the Database Management window, under the “Update instruments” section, ensure that “General properties”, "Futures expiries" and “Symbol mappings” options are checked and then click Update
- Lastly, restart NinjaTrader for the changes to occur
If this does not resolve your inquiry, could you reach out to me at platformsupport [at] ninjatrader [dot] com with the ticket ID "1856413" and the text "ATTN Jim?"
I look forward to looking into this further with you.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
332 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment