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)
Hi,
I colored few indicators with PlotColors using Ninja help as an example. Every time I start the Ninja my colored indicators loosing colors, e.g. the rising, falling and neutral plots become transparent and I have to reset the colors in properties of the indicator. I'm not very good at programming in C# and there could be bugs in my code... Ninja provides very poor PlotColors example in online help. There is only one example on how to set static colors.
I'm attaching one of the indicators with call to PlotColors built in that loosing colors at start up. Is there an error in my code? I do not see it.
Thank you very much.
Can you help answer these questions from other members on NexusFi?
And now tell me, why you have put this in front of the section for the color serialization:
It is my understanding - I may be wrong - that this line will prevent the indicator from proper serialization, so if you store the indicator in a template, it might lose its color memory. The XmlIgnore() command should only be used for DataSeries objects that cannot be serialized.
Also proper serialization should make disappear the main plot, which is no longer needed. This is achieved via
But then you need to serialize PlotStyle, DashStyle and LineWidth separately, which I have done. Now the indicator dialogue box only shows the necessary information for the colored plot.
I have further simplified the code, and - to speed the indicator up - created an SMA object, which is initialized in OnStartUp().
Can we use the SMAColorsV7's PlotColors as strategy trigger?
like
if (SMAColorsV7.PlotColors[0][0] == Color.Red)
EnterShort();
Fat Tails
And now tell me, why you have put this in front of the section for the color serialization:
[XmlIgnore()]
It is my understanding - I may be wrong - that this line will prevent the indicator from proper serialization, so if you store the indicator in a template, it might lose its color memory. The XmlIgnore() command should only be used for DataSeries objects that cannot be serialized.
Also proper serialization should make disappear the main plot, which is no longer needed. This is achieved via
PlotsConfigurable = false;
But then you need to serialize PlotStyle, DashStyle and LineWidth separately, which I have done. Now the indicator dialogue box only shows the necessary information for the colored plot.
I have further simplified the code, and - to speed the indicator up - created an SMA object, which is initialized in OnStartUp().