I set up 3 WMA lines on a chart manually via Indicator dialog box configured with High, Median and Low. I coded a testWMA strategy to be like this chart (indicator set up). I ended up with all three lines overlapping even I use High, Median and Low in the code. I tried different ways to separate the lines with no luck. Can you tell me what is correct way to do it?
See attached picture.
Thanks much in advance!
traderjh
public class testWMA : Strategy { #region Variables private int upper = 5; private int middle = 5; private int lower = 5; private DataSeries upperPrice; private DataSeries middlePrice; private DataSeries lowerPrice; #endregion protected override void Initialize() { CalculateOnBarClose = false; Add(WMA(upper)); Add(WMA(middle)); Add(WMA(lower)); WMA(upper).Plots[0].Pen.Color = Color.LimeGreen; WMA(middle).Plots[0].Pen.Color = Color.Blue; WMA(lower).Plots[0].Pen.Color = Color.Red; WMA(upper).Plots[0].Pen.Width = 3; WMA(middle).Plots[0].Pen.Width = 3; WMA(lower).Plots[0].Pen.Width = 3; upperPrice = new DataSeries(this); middlePrice = new DataSeries(this); lowerPrice = new DataSeries(this); } protected override void OnBarUpdate() { upperPrice.Set(WMA(High,upper)[0]); middlePrice.Set(WMA(Median,middle)[0]); lowerPrice.Set(WMA(Low,lower)[0]); } #region Properties #endregion
Comment