Announcement
Collapse
No announcement yet.
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 Hwop38, 05-04-2026, 07:02 PM
|
0 responses
164 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
318 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
246 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
350 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
179 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment