I built a custom indicator and want to color positive bars green and nehative bars red.
I wrote the following after Initialize():
Add(new Plot(new Pen(Color.LimeGreen, 5), PlotStyle.Bar, "Up"));
Add(new Plot(new Pen(Color.Red, 5), PlotStyle.Bar, "Down"));
And after OnBarUpdate():
if( Value[0] > 0 )
BarColor = Color.LimeGreen;
elseif( Value[0] < 0 )
BarColor = Color.Red;
My plot though is always green, also for negative values. Why?
Thank you for help
Comment