I want to allow the user to be able to enable/disable individual lines by toggling enable/disable properties in the Indicators dialog. So in Initialize() I just refrain from adding the unwanted line. That means I now have only two lines, instead of the previous 3 lines Add()ed. At the end of Initialize() all is fine -- Lines[] has the right things, and only the right things -- two lines.
The problem is that on entry to OnStartup() NT has taken it upon itself to restore the unwanted 3rd line to Lines[]! Yuck! NT restores Lines[] to a now-obsolete state! It looks as if I am going to have to clean up Lines[] myself on entry to OnStartup(). Perhaps I can save Lines[] at the end of Initialize() and restore it on entry to OnStartup() ... I just HATE having to do battle with obscure NT foolishness.
If anyone knows how to tell NT to not mess with the Lines[] array after I set it up in Initialize(), please let me know!
--EV
P.S. Please do not bother to remind me of setting unwanted lines transparent. That can work, but it's pretty much a kludge. I did that in a recent indicator -- that's what got me to make persistent data properties work. Getting it right from a usability point of view is a lot easier said than done, so I want this more straightforward way to work -- just don't add in lines you don't want. Removing unwanted lines is also a lot cleaner GUI -- if you disable it, it disappears from the GUI as well as from the chart.
Comment