What're the pros and cons of of the following two possible solutions:
1.
// put it Indicator variable and init in the Initialize()
value = Bollinger(14,2).Middle[0];
and reference the 'value' inside OnBarUpdate() as
Plot.Set(myFunction(value));
2. or just do it inside OnBarUpdate() as
Plot.Set(myFunction(Bollinger(14,2).Middle[0]));
I would assume the (1) choice is better in that, the Bollinger object will not be created on EVERY OnBarUpdate call, a very expensive option particularly if the CalculateOnBarClose is false!
Please correct me if I am wrong on this. Thanks.
Comment