I need a little help on understanding why this does not work.
I am trying to change the color of the fill between 2 EMAs depending on the slope of the EMAs. I have debugged and the different part of the statement are hit at the right times so it seems that the color value is somehow overwritten as the area fill only has one color.
protected override void OnBarUpdate()
{
if(CurrentBar < EmaHighLen)
return;
if(emaHigh[0]> emaHigh[1] && emaHigh[0]> emaHigh[2] && emaHigh[0]> emaHigh[3])
Draw.Region(this, CurrentBar+"tag1", CurrentBar, 0, emaHigh, emaLow, null, Brushes.Green, 25);
else if(emaHigh[0]< emaHigh[1] && emaHigh[0] < emaHigh[2] && emaHigh[0] < emaHigh[3])
Draw.Region(this, CurrentBar+"tagDown", CurrentBar, 0, emaHigh, emaLow, null, Brushes.Red, 25);
else
Draw.Region(this, CurrentBar+"tagNeutral", CurrentBar, 0, emaHigh, emaLow, null, Brushes.Gray, 25);
}
Sune

Comment