I'm overloading OnTermination with some code to clean up and log stuff in my indicator and I have hit a problem.
When I am running my indicator and I re-load the ninjascript from the right-click menu, the OnTermination event triggers at some point as a consequence. I do some stuff with the multiple bars and the CurrentBar number etc.
I just found that re-loading the historical data calls the OnTermination event but at a different point, a point at which something in the BarsArray had been cleaned up by Ninja already and it caused my OnTermination code to break.
Can you tell me what one single variable or state can I check in my OnTermination event to determine whether Ninja is stopping the indicator script?
e.g. is there something useful like Indicator.ScriptTerminatingNow
Comment