I'm developing a custom indicator, an EMA.
I want it to change color depending of the slope of the EMA
So, on Initialize I have:
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "MyMA"));
And OnBarUpdate()
if (MyMA[0] > (MyMA[1] )
{
MyMA[0].Color = Color.Green;
}else if (MyMA[0] < (MyMA[1] )
{
MyMA[0].Color = new Color(Color.Red);
}else
{
MyMA[0].Color = new Color(Color.Ivory);
}
being MyMA the Plot draw by the indicator.
Well, it does not work :-(
What shouyld I code?
Thanks
Comment