I believe Indicator calculations can be CPU expensive/exhaustive when using OnPriceChange calculations and when lots of CPU resources are being used.
I have some questions for clarification:
> how often do indicators re-calculate with OnPriceChange? Do they re-calculate on every price change or just when indicator or strategy calls an indicator value? I believe NT8 only computes indicator values when indicator or strategy calls for an indicator value ie/ OnBarUpdate: if price greater than "Trendline" && indicator[0] > "value.
> More specifically, if I call indicator value[1] from one bar ago will NinjaTrader 8 recalculate or compute indicator value every time or are indicator values from [1] one bar ago treated as static values and NT8 does not recalculate or compute indicator value as it has already been done? Further, what is quicker and less CPU expensive (a) calling indicator values from previous bars [1][2][3] or calling private double ?
In my situation I am calling indicator values for previous bars [1][2] allot in my code and want to ensure NT8 is not recalculating or computing the indicator values otherwise I will just create private double and call that double.
Appreciate the clarification to best manage CPU resources.
Blairski
Comment