I'm trying to work out how to plot a SMA with a period of 12 on a chart.
I used the wizard for this.
Code is as such....
#region Variables
// Wizard generated variables
privateint period12 = 12; // Default setting for Period12
#endregion
protectedoverridevoid Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.CornflowerBlu e), PlotStyle.Line,"Plot12"));
Overlay = true;
CalculateOnBarClose=false;
.....//This section I can't work out?
protectedoverridevoid OnBarUpdate()
{
Plot12.Set(SMA(period12); ??
}
How do I set Plot 12 to the SMA period12? So that it will plot the SMA of period value 12.
Thanks
Bruce
Comment