I want to add 2 indicators to a chart with plot for addtional conditions but there is an issue I cant find out. What is wrong in my coding, as there is always plotted only one:
protected override void Initialize()
protected override void Initialize()
{Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "HMAPlot"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "SMAPlot"));
Plots[0].Pen.Width = 2; Plots[0].Pen.DashStyle = DashStyle.Dash;
Plots[1].Pen.Width = 2; //Plots[1].Pen.DashStyle = DashStyle.Dash;
Overlay = true;
Add(hmAPeriodType,hmAPeriodInterval);
Add(smAPeriodType,smAPeriodInterval); }
protected override void OnStartUp()
{hma=HMA(hmALength);
sma=SMA(smALength);}
protected override void OnBarUpdate()
{
if (CurrentBars[1]>0 && CurrentBars[0]>0)
{HMAPlot[0] = hma[0];
PlotColors[0][0] = Rising(hma) ? hrisingColor : Falling(hma) ? hfallingColor : hneutralColor;
SMAPlot[1] = sma[1];
PlotColors[0][0] = Rising(sma) ? srisingColor : Falling(sma) ? sfallingColor : sneutralColor;}
THANK YOU!
Tony
Comment