Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I have a problem with the way the plots are initialized. Here comes a small indicator. Please apply it to a default ES chart and then just follow the instructions.
Any idea, what is wrong?
Can you help answer these questions from other members on NexusFi?
My original problem can be better understood with this indicator.
The plot is not re-initializing, when toggling from one instrument to another. I expected that the plot would reinitialize, because it is in the Initialize() section! But toggling does not initialize the plot, because you want to keep the colours and pen properties, so I was trapped.
Apply to any instrument, then toggle between instruments. Plot.Name of first instrument remains active, until you hit FDAX. Then Plot.Name will remain FDAX.
That is correct. The main idea of this thread was to show that an indicator is not reinitialized, if you toggle from one instrument to another, where as OnStartUp() is executed when toggling. Reinitializing is not possible, because you want to keep some of the properties defined, such as the colors of the plot.
So if you initialize the plots by using the name of an instrument, it will stay with the first instrument for ever. Conclusion: You should not use any reference to Instrument.MasterInstrument.Name in the Intialize() section, but do that in OnStartUp().
Your suggestion compensates the error in the Initialize() section, but to code this in a clean way, the error should not be made in the first place!