I have been busy creating a indicator that plats two lines that run in parrell but constantly moving accroding to the set criteriea. For some reason i have missed something in the coding and would like assistance. The code is working well but only generating one line not two as it should as well as the signals appear to be getting mixed up. I am using NT7 so as you can see from the coding i have built in a BarsArray , which appears to be in the right sequence. Here is a snapshot of all the solid items in the indicator. I assume it is something small that i have missed placed, but i cannot seem to get it right. Thanks in advance.
protectedoverridevoid Initialize()
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "Plot0"));
Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Plot1"));
protectedoverridevoid OnBarUpdate()
{ if (CurrentBar < Period) return;
if (BarsInProgress != 0)
return;
double average = SMA(Close, Period)[0];
Plot0.Set((SMA(BarsArray[1],timeperiod)[1] / SMA(timeperiod)[1]*1000)+28);
Plot1.Set((SMA(BarsArray[1],timeperiod)[1] / SMA(timeperiod)[1]*1000)-28);
}
Comment