private DataSeries smaStop;
In Initialization section
Add(new Plot(Color.Blue, "SMA"));
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Hash, "smaStop"));
smaStop = new DataSeries(this);
OnBarUpdate () method
// the added smaStop code to go here similar to below
// with idea to trail SMA
smaStop.Set(SMA(20)[0]*0.97);
The image above is the SMA 20 based on close(blue line) and SMA 20 based on low(red hash line). However, what I would like to achieve is the SMA line and a hash line based on a percent below the SMA line. Your help is appreciated. Thanks, Jim
Comment