Have a few different SMA's on an indicator and I want to make sure they layed on top on each over in the correct order.
SMA's are 200,50,12
I want the 50 SMA to be under the 200 and 12. At the moment its a random thing when I load onto a chart.
Code is as follows......
protectedoverridevoid Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.CornflowerBlu e), PlotStyle.Line, "Plot12"));
Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "Plot50"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot200"));
Overlay = true;
CalculateOnBarClose=false;
}
protectedoverridevoid OnBarUpdate()
{
Plot12.Set(SMA(period12)[0]);
Plot50.Set(SMA(period50)[0]);
Plot200.Set(SMA(period200)[0]);
}
Can I overlay the 200 and 12 over the 50 SMA?
Thanks
Bruce
Comment