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 cmoran13, 04-16-2026, 01:02 PM
|
0 responses
42 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
25 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|
||
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
162 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
98 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
157 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|

Comment