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
Calling Update() but to recalculate for every bar
Collapse
X
-
Calling Update() but to recalculate for every bar
When Update() is called, the indicator will use OnBarUpdate() to ensure the Values are updated to the current bar. However - what if I want the values for ALL bars to be re-calculated? Is there a way to set the internal 'completed' flag to false for the bars? Without having to totally refresh the indicator or call F5Tags: None
-
I think you're mixing apples and oranges thinking both fruits are the same.
If the Values are 'up-to-date' for the current bar, then by definition, they are
'up-to-date' for all bars before that -- OnBarUpdate is accumulative.
A full 're-calculation' is not equivalent to the concept behind what Update()
is doing -- and neither is Update() the tip of the spear of what F5 is doing.
-
Thanks for your input - I understand that, but should have been more clear. I have a WPF Button on the chart which I use to adjust the value of one of a Simple MA indicator's inputs (the period of the MA). When I click the button, the MA period changes from 7 to 14. Once I click this button to change the period, I want all of the Values for the indicator to be re-calculated. I can do this by manually refreshing/re-loading entirely with F5 after clicking the button to change the period, or I can force a SendKeys() call to F5 once the button is clicked, but don't want to have to do this. I want a method which re-calculates all Values for the indicator without necessarily re-loading/refreshing/restarting the indicator entirely.
The reason I want to avoid using F5 is because I have another indicator on the chart which takes a very long time to load. I want the Simple MA indicator to re-calculate its Values discreetly without me having to F5 the chart, which causes this other indicator to have to re-load/refresh as well.
In other words, once I click this button to change the MA period, I want the indicator to recognize that all of its Values are no longer 'up-to-date' for any bar, so that it automatically re-calculates everything. Think this is possible?Last edited by NicholasJoannette; 07-31-2021, 08:35 PM.
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
238 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
382 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
1 view
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
||
Started by pechtri, 06-22-2023, 02:31 AM
|
10 responses
125 views
0 likes
|
Last Post Today, 12:03 AM | ||
Started by judysamnt7, 03-13-2023, 09:11 AM
|
4 responses
59 views
0 likes
|
Last Post
by DynamicTest
Yesterday, 08:25 PM
|
Comment