Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.JimNinjaTrader Customer Service
-
Hello hansob3,
Each bar, historical or realtime, will update with each tick if Tick Replay is enabled and Calculate is set to On Each Tick. Simply put: Tick Replay will allow historical bars to build with each tick.
Please let us know if we can be of further help.JimNinjaTrader Customer Service
Comment
-
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.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kezyclaire, 12-01-2023, 09:37 AM
|
3 responses
151 views
0 likes
|
Last Post Today, 07:03 AM | ||
Started by volIQ, Yesterday, 04:28 PM
|
1 response
13 views
0 likes
|
Last Post Today, 06:55 AM | ||
Started by martini, Yesterday, 04:45 PM
|
1 response
10 views
0 likes
|
Last Post Today, 06:45 AM | ||
Started by proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
26 views
0 likes
|
Last Post Today, 05:17 AM | ||
Started by MaupinFinche, Today, 05:08 AM
|
0 responses
7 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
Comment