Thanks!
-------------------------------------------------------------------------------
Code for Panel 3 indicator which works fine:
if ((SMA(5)[0]>=SMA(15)[0]) && (SMA(15)[0]>=SMA(50)[0]))
BackColor = Color.Lime;
if ((SMA(5)[0]<SMA(15)[0]) && (SMA(15)[0]<SMA(50)[0]))
BackColor = Color.Red;
-------------------------------------------------------------------------------
Code for Panel 2 indicator does not plot correctly as shown in pic:
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Block, "tF0"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Block, "uTF1"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Block, "uTF2"));
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Block, "uTF3"));
Add(PeriodType.Minute, timePeriod);
Add(PeriodType.Minute, timePeriod2);
Add(PeriodType.Minute, timePeriod3);
Plots[0].Pen.Width = 3;
Plots[1].Pen.Width = 3;
Plots[2].Pen.Width = 3;
Plots[3].Pen.Width = 3;
Overlay = false;
PaintPriceMarkers = false;
}
protected override void OnBarUpdate()
{
if (CurrentBar<200)
return;
if ((SMA(BarsArray[1],5)[0])>=(SMA(BarsArray[1],15)[0]) &&
(SMA(BarsArray[1],15)[0])>=(SMA(BarsArray[1],50)[0]))
PlotColors[0][0] = upColor;
else if ((SMA(BarsArray[1],5)[0])<(SMA(BarsArray[1],15)[0]) &&
(SMA(BarsArray[1],15)[0])<(SMA(BarsArray[1],50)[0]))
PlotColors[0][0] = downColor;
if ((SMA(BarsArray[2],5)[0])>=(SMA(BarsArray[2],15)[0]) &&
(SMA(BarsArray[2],15)[0])>=(SMA(BarsArray[2],50)[0]))
PlotColors[1][0] = upColor;
else if ((SMA(BarsArray[2],5)[0])<(SMA(BarsArray[2],15)[0]) &&
(SMA(BarsArray[2],15)[0])<(SMA(BarsArray[2],50)[0]))
PlotColors[1][0] = downColor;
if ((SMA(BarsArray[3],5)[0])>=(SMA(BarsArray[3],15)[0]) &&
(SMA(BarsArray[3],15)[0])>=(SMA(BarsArray[3],50)[0]))
PlotColors[2][0] = upColor;
else if ((SMA(BarsArray[3],5)[0])<(SMA(BarsArray[3],15)[0]) &&
(SMA(BarsArray[3],15)[0])<(SMA(BarsArray[3],50)[0]))
PlotColors[2][0] = downColor;
if ((SMA(5)[0])>=(SMA(15)[0]) && (SMA(15)[0])>=(SMA(50)[0]))
PlotColors[3][0] = upColor;
else if ((SMA(5)[0])<(SMA(15)[0]) && (SMA(15)[0])<(SMA(50)[0]))
PlotColors[3][0] = downColor;
tF0.Set(3); //plots on top
uTF1.Set(2);
uTF2.Set(1);
uTF3.Set(0); //plots on bottom
Comment