It really depends on what you are trying to do.
If you are trying to get a value at startup time that you want not to change then you should not put this in OnBarUpdate.
If you are trying to call the value of an indicator on every bar then put this in OnBarUpdate.
May I ask, what are you trying to accomplish?
Comment