Colour a specific area

Hi!

I have created the code below for a Squeeze indicator:
//SQUEEZE

BolUp = BBandTop(Close,20,2);
BolDown = BBandBot(Close,20,2);

TypPrice = MA((High + Low + Close) / 3,20);

KeltUp = (ATR(20) * 1.5) + TypPrice;
KeltDown = TypPrice - (ATR(20) * 1.5);

SqueezeUp = BolUp - KeltUp;
SqueezeDown = BolDown - KeltDown;

Filter = Close > 1;

Plot( SqueezeUp,"SqueezeUp",colorBlue);
Plot( SqueezeDoeDown",colorRed);
Plot(1,"Target",colorGreen);

I would like to colour the area between the SqueezeUp line and the 1 line in
one colour, and the area between the SqueezeDown line and the 1 line in a
different colour.

How can I do this? Thanful for all help!

Leif Axelsson

You should use code tags if adding code!

style = styleCloud | styleNoLabel;

Plot(1,"Target",colorGreen);
PlotOHLC( SqueezeUp, SqueezeUp, 1, 1,"SqueezeUp", colorBlue, style );
PlotOHLC( 1, 1, SqueezeDown, SqueezeDown, "SqueezeDown", colorRed, style);

2 Likes

Hi!

Many thanks!

/Leif

IMO, this is an example where in AmiBroker we miss the possibility of having transparent colors that overlap.

@Tomasz, is there any hope for colors with an alpha channel in a future version?

Transparency is supported now via Z ordering and hollow fill Color.

Translucency which is different from transparency is not available in windows GDI, but it is possible in QuickGFX and will arrive pretty soon

4 Likes