extrA = C < O;
extrB = Ref(C, -1) > Ref(O, -1); // -- I am assuming that you want yesterday's close to be > yesterday's open
barRange = H-L;
avgRange50 = MA(barRange, 50);
extrC = Ref(barRange, -1) > (2* Ref(avgRange50, -1));
body = Abs(C - O);//this is common condition
smallBody = (body >= (0.5 * barRange)) AND (body <= (0.85 * barRange));
extrD = Ref(smallBody, -1);
Cent = abs(HIGH + LOW) / 2;
extrA1 = C>O;
extrB1 = Ref(C, -1) < Ref(O, -1);
extrC1 = Ref(barRange, -1) > (2* Ref(avgRange50, -1));
extrD1 = Ref(smallBody, -1);
buy = extrA AND extrB AND extrC AND extrD;
Sell = extrA1 AND extrB1 AND extrC1 AND extrD1;
PlotShapes(IIf(Buy,shapeSmallCircle,shapeNone),colorwhite, 0,Cent, Offset= 0);
PlotShapes(IIf(sell,shapeSmallCircle,shapeNone),colorwhite, 0,Cent, Offset= 0);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
trA = C < O;
trB = (H - O) >= (3.25 * (O - C));
trC = (C - L) <= (0.35 * (H - L));
barRange = H-L;
trD = barRange >= (1.1 * MA(barRange, 50));
trA1 = C>O;
trB1 = (O-L)>=(3.25*(C-O));
trC1 = (H-C)<=(0.35*(H-L));
trD1 = barRange >= (1.1 * MA(barRange, 50));
Buy1 = trA AND trB AND trC AND trD;
Sell1 = trA1 AND trB1 AND trC1 AND trD1;
PlotShapes(IIf(Buy1,shapeSmallCircle,shapeNone),colorwhite, 0,Cent, Offset= 0);
PlotShapes(IIf(sell1,shapeSmallCircle,shapeNone),colorwhite, 0,Cent, Offset= 0);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
orA = C < O;
orB = H > Ref(H, -1);
orC = L < Ref(L, -1);
barRange = H-L;
orD = barRange >= (1.25 * MA(barRange, 50));
orE = C < Ref(L, -1);
orF = Ref(C,-1)>Ref(O,-1);
orA1 = C > O;
orB1 = H > Ref(H, -1);
orC1 = L < Ref(L, -1);
barRange3 = H-L;
orD1 = barRange3 >= (1.25 * MA(barRange3, 50));
orE1 = C > Ref(H, -1);
orF1 = Ref(C,-1)<Ref(O,-1);
Buy2= orA AND orB AND orC AND orD AND orE AND orF;
Sell2= orA1 AND orB1 AND orC1 AND orD1 AND orE1 AND orF1;
PlotShapes(IIf(Buy2,shapeSmallCircle,shapeNone),colorwhite, 0,Cent, Offset= 0);
PlotShapes(IIf(Sell2,shapeSmallCircle,shapeNone),colorwhite, 0,Cent, Offset= 0);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
barRange4 = H-L;
djA = barRange4 <= (0.65 * MA(barRange4, 50));
body2 = Abs(C - O);
smallBody2 = (body2 <= (0.1 * barRange4));
djB = smallBody2;
Buy3= djA AND djB;
PlotShapes(IIf(Buy3,shapeSmallCircle,shapeNone),colorwhite, 0,Cent, Offset= 0);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|