I'm trying to color a region between two MAs, lets say 10-period EMA and 25-period EMA. and I want to color the region between them in such a way that if 10-EMA is above 25-EMA its green and if its below the shaded region is red. is there a way to achieve that using DrawRegion ?
This is how I'm trying to use it. in this case based on the most recent value the entire region changes color :
if (ema10[0] >= ema25[0])
{
DrawRegion(CurrentBar.ToString()+"Shaded",CurrentB ar,0,ema10,ema25,Color.Empty,upColor,1);
}
else
{
DrawRegion(CurrentBar.ToString()+"Shaded",CurrentB ar,0,ema10,ema25,Color.Empty,dnColor,1);
}
thanks in advance for your help
Comment