How to detect a Elephant Bar ? aka Wide Range Bar

#1
Hello all! :thumb:

I'm trying to identify WRB using afl but i already tried a hundred ways and nothing!!!

This is the last code...

Code:
//ElefanteDown = (O > C) AND ((O-C) > ((Median(O,19) - Median(C,19))));
ElefanteDown = (O > C) AND Volume > Median(Volume, 19) AND (O-C) > (Median((O-C),19));
PlotShapes(IIf(ElefanteDown==true, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
I know this code is useless but well....

A WRB is a bar with the green (in the up case...) part bigger than the last 20 green bars....
 

amitrandive

Well-Known Member
#2
Hello all! :thumb:

I'm trying to identify WRB using afl but i already tried a hundred ways and nothing!!!

This is the last code...

Code:
//ElefanteDown = (O > C) AND ((O-C) > ((Median(O,19) - Median(C,19))));
ElefanteDown = (O > C) AND Volume > Median(Volume, 19) AND (O-C) > (Median((O-C),19));
PlotShapes(IIf(ElefanteDown==true, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
I know this code is useless but well....

A WRB is a bar with the green (in the up case...) part bigger than the last 20 green bars....
Definition of wrb can be a problem. If we define wrb as a bar that has a range > 3x of recent atr, then the same can be done in following afl:

Code:
avgTr = ATR(14);
Filter = (H-L) > (avgTr * 3);
 
#3
Definition of wrb can be a problem. If we define wrb as a bar that has a range > 3x of recent atr, then the same can be done in following afl:

Code:
avgTr = ATR(14);
Filter = (H-L) > (avgTr * 3);
This is the Oliver Velez definition:

"Measure the green part only. More green in the bar on average than the last 20 green bars."
 

casoni

Well-Known Member
#7
Hello ,
How about this



Code:
// from VSA - By Karthikmarar
per=Param("Ma per" ,30,20,60,1);
wbf		= Param("WRB factor",1.5,1.3,2.5,.1);
nbf		= Param("NRB factor",0.7,0.3,0.9,0.1);
rg		= (H-L);
arg		= Wilders(rg,per);
wrb		= rg > (wbf*arg);
nrb		= rg < (nbf*arg); 
upbar	= C > Ref(C,-1); // C>O
dnbar	= C < Ref(C,-1); // C<O
wup=wrb AND upbar; 
wdn=wrb AND dnbar;

Plot(C,"",3,132);

xx=BarIndex();x=xx;Lx=LastValue(x);  
fvb=Status("firstvisiblebarindex"); 
lvb=Min(Lx,Status("lastvisiblebarindex"));
Font= ParamList("Font:","Arial|Berlin Sans FB|Book Antiqua|Candara|Calibri|Tahoma|Times New Roman|Engravers MT| ",5);
for(i=fvb;i<lvb;i++)  
{ 
    if(WUP[i]) PlotTextSetFont("+ E.B",Font,8,i,L[i],colorpaleGreen,colorDefault,-30);  
    if(WDN[i]) PlotTextSetFont("- E.B",Font,8,i,H[i],colororange,colorDefault,30);  
    if(nrb[i]) PlotTextSetFont("Nrb",Font,8,i,L[i],colorBlue,colorDefault,-30);  
   
}
 
#8
Hello ,
How about this



Code:
// from VSA - By Karthikmarar
per=Param("Ma per" ,30,20,60,1);
wbf		= Param("WRB factor",1.5,1.3,2.5,.1);
nbf		= Param("NRB factor",0.7,0.3,0.9,0.1);
rg		= (H-L);
arg		= Wilders(rg,per);
wrb		= rg > (wbf*arg);
nrb		= rg < (nbf*arg); 
upbar	= C > Ref(C,-1); // C>O
dnbar	= C < Ref(C,-1); // C<O
wup=wrb AND upbar; 
wdn=wrb AND dnbar;

Plot(C,"",3,132);

xx=BarIndex();x=xx;Lx=LastValue(x);  
fvb=Status("firstvisiblebarindex"); 
lvb=Min(Lx,Status("lastvisiblebarindex"));
Font= ParamList("Font:","Arial|Berlin Sans FB|Book Antiqua|Candara|Calibri|Tahoma|Times New Roman|Engravers MT| ",5);
for(i=fvb;i<lvb;i++)  
{ 
    if(WUP[i]) PlotTextSetFont("+ E.B",Font,8,i,L[i],colorpaleGreen,colorDefault,-30);  
    if(WDN[i]) PlotTextSetFont("- E.B",Font,8,i,H[i],colororange,colorDefault,30);  
    if(nrb[i]) PlotTextSetFont("Nrb",Font,8,i,L[i],colorBlue,colorDefault,-30);  
   
}
some EB false.

I used this:

Code:
(H-L) > ((ATR(19)*2)) AND O > C
 

mastermind007

Well-Known Member
#9
Hello all! :thumb:

I'm trying to identify WRB using afl but i already tried a hundred ways and nothing!!!

This is the last code...

Code:
//ElefanteDown = (O > C) AND ((O-C) > ((Median(O,19) - Median(C,19))));
ElefanteDown = (O > C) AND Volume > Median(Volume, 19) AND (O-C) > (Median((O-C),19));
PlotShapes(IIf(ElefanteDown==true, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
I know this code is useless but well....

A WRB is a bar with the green (in the up case...) part bigger than the last 20 green bars....

not sure if I am even on the same page, but, I've been using this formula for a while now. was written by someone else. I primarily use them in EOD to
tighten the stop loss if position is already having good profit.

Code:
bigRed = (Open - Close)/ Open > 0.015 AND (Open - Close) * 2 > (High - Low);
bigWhite = (Close - Open)/Open > 0.015 AND (Close - Open) * 2 > (High - Low);
 

mastermind007

Well-Known Member
#10
Hello all! :thumb:

I'm trying to identify WRB using afl but i already tried a hundred ways and nothing!!!

This is the last code...

Code:
//ElefanteDown = (O > C) AND ((O-C) > ((Median(O,19) - Median(C,19))));
ElefanteDown = (O > C) AND Volume > Median(Volume, 19) AND (O-C) > (Median((O-C),19));
PlotShapes(IIf(ElefanteDown==true, shapeDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
I know this code is useless but well....

A WRB is a bar with the green (in the up case...) part bigger than the last 20 green bars....

not sure if I am even on the same page, but, I've been using this formula for a while now. It was written by someone else. I primarily use them in EOD to tighten the stop loss if position is already having good profit.

Code:
bigRed = (Open - Close)/ Open > 0.015 AND (Open - Close) * 2 > (High - Low);
bigWhite = (Close - Open)/Open > 0.015 AND (Close - Open) * 2 > (High - Low);