Hello
I want to create a Demand area containing a long candle down body greater than >=80%
from the top and the lowest
Includes body candles less than <=50% of the top and lowest
and then a long candle UP
body is greater than 80%
from the top and the lowest
tmp1=abs((High-Low))/2;
tmp2=abs((Open-Close));
BaseCandleColor=ParamColor("BaseCandleColor",colorWhite);
setbarFillColor(IIf(tmp2<=tmp1 ,BaseCandleColor,IIf(C<=O,colorRed,colorBlue)));
Plot(C,"Price",IIf(C>O,ColorRGB(0,0,255),IIf(C<=O,ColorRGB(240,0,0),colorDefault)),64,0,0,0,0,1);
_SECTION_BEGIN("");
//ERC
/*
HX=(H-C);
LX=(O-L);
HY=(H-O);
LY=(C-L);
*/
upX=IIf((C>O),1,0);
downX=IIf((C<O),1,0);
bwh= ((H-C)+(O-L))>(O+C) AND upX==1 ;
bbl=(((H-O)+(C-L))>(O+C)) AND downX==1 ;
PlotShapes(bwh*shapeHollowSmallSquare, colorRed, 0, H,Offset=5);
PlotShapes(bbl*shapeHollowSmallSquare, colorRed, 0, H,Offset=5);
//gg=HHHB==1 AND upX==1 ;
g3=Ref(C,-1)<Ref(l,-2) AND Ref(C,-1)<Ref(O,-1) AND Ref(C,-2)<Ref(O,-2)AND C>O AND ( C>= Ref(H,-1) );
gm=Ref(C,-1)>Ref(H,-2) AND Ref(C,-1)>Ref(O,-1) AND Ref(C,-2)>Ref(O,-2)AND C<O AND ( C<= Ref(l,-1) );
PlotShapes(gm*shapeSmallCircle, colorOrange, 0, H,Offset=5);
PlotShapes(g3*shapeSmallCircle, colorBlue, 0, L,Offset=-5);
/*
iif(bbl,
PlotShapes(gm*shapeSmallCircle, colorRed, 0, h),0);
iif(bwh,
PlotShapes(g3*shapeSmallCircle, colorBlue, 0, l),0);
*/
//PlotShapes(IIf(MLLLB, shapeSmallCircle, shapeNone),colorBlack, 0, L, Offset=-5);
//BACEL=
engulfingg3=Ref(C,-1) < Ref(O,-1) And CLOSE > OPEN And CLOSE >= Ref(h,-1) ;
PlotShapes(IIf(engulfingg3, shapeCircle, shapeNone),colorGreen, 0, L, Offset=-20);
engulfinggm=Ref(C,-1) > Ref(O,-1) And CLOSE < OPEN And CLOSE <= Ref(l,-1) ;
PlotShapes(IIf(engulfinggm, shapeCircle, shapeNone),colorYellow, 0, h, Offset=20);
_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();