Want to see a demo? Please download the indicator attached, and put it on a chart, then load any other indicator, and see what happens. As the TextFixed object belongs to the posted indicator, it is obvious that loading another, unrelated indicator onto the chart, is running a method in the previously loaded indicator. Why?!?
Funnily enough, if when loading the second indicator, one does it by "Apply"ing, then cancelling, the spurious State.Terminated code does not run, and the indicators are all loaded. This means incontrovertibly, that the spurious run only happens when one hits "OK" to load the indicator. Regardless, the termination routine of a class should not be triggered by anything from anywhere, but the actual, conscious, termination of the class itself.
No, the workaround that I have described is not a valid response to this. Encapsulation rules must be obeyed. ALWAYS!
Comment