I have done this code:
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(Close[0]);
BarColor = Color.Yellow;
PlotColors[0][0] = Color.Yellow;
if ((Close[0] > Close[1]))
{
PlotColors[0][0] = Color.Lime;
BarColor = Color.Green;
}
else
{
if ((Close[0] < Close[1]))
{
BarColor = Color.Red;
PlotColors[0][0] = Color.Red;
}
}
}
Any help?

Comment