From time to time, I need to do calculations after OnBarUpdate is finished (mostly additional graphics, database updates, …)
So far, I’m using two ways to detect when OnBarUpdate is finished. One is within OnBarUpdate testing for the last CurrentBar. The other way is to wait until the state is set to Transition (see the attached indicator. Easy to understand).
I see both advantage and disadvantage of the two approaches.
Testing for the last CurrentBar seems to very “safe”. Using State = Transition is the most elegant, but code must be written to handle multiple calls, which can happen.
If anyone has any comments about this, or if the support team has any NinjaScript Best Practices, I am happy to read about it.
Regards, AndBro

Comment