MessageBox.Show( "Count: " + count);
Inside of Initialize. I put a count there just so I could make sure that Initialize was not being called multiple times. Which it was not. Rather, each was a new instantiation. And given I am loading quite a bit of data, this does not work. I find that it got called at each of the following points:
1. When I had a chart up and clicked the "Add Indicator" button
2. A 2nd time when I actually clicked on my indicator(on the list with the others)
3. A 3rd and 4th time when I click apply to add my indicator to the chart
Everything else works fine, but the indicator gets instantiated a total of four times. Which ends up chewing up a bunch of memory.
Do you have any sort of "true" Initialize that only gets called when an indicator class is really actually going to be used? Or do I need to sort of simulate my own by using a temp variable and detecting the first time that OnBarUpdate is called. Then if so, when is Initialize actually supposed to use, given that NT seems to be creating quite a few temporary objects before it actually uses my indicator.
Also, is any sort of method called when an indicator is "closed", like when the chart it is attached to is closing? So I can unload things?
Comment