I have created the code below code that changes the bar color depending on how signal1 and signal2 below work inside OnBarUpdate().
My issue is that this is working perfect on the current candle but as soon as it closes, the old bar goes back to the default color.
How do I keep the color on all the old bars?
Thanks in advance!
if (signal1[0]==1)
{
BarBrushes[0]=Brushes.Red;
}
else if (signal2[0]==1)
{
BarBrush=Brushes.LimeGreen;
}
else
{
BarBrush=Brushes.Gray;
}
Comment