This piece of code plots buy/sell arrows on days of extremely one-sided
volume breadth.  "^NYSEBR" is a dummy ticker with breadth data. 
"Cond2A" is a filter that excludes low-volume extreme days.

"Cond2A" filters out the low-volume days as it should on the "Buy" days,
but it filters out ALL of the "Sell" days, with no sell arrows
displayed.   Removing "AND Cond2A" from the "Sell" condition restores
the sell arrows, but without filtering them.  Can anyone tell me why and
how to fix it?  Based on my knowledge of AB it ought to work, but just
isn't for a reason I can't figure out.

TIA,

Sebastian



//Shows all 90% up/down or double 80% up volume days.

SetBarsRequired( 100000, 100000 ); // require all past and all future
bars

Cond1=Foreign("^NYSEBR","V")/(Foreign("^NYSEBR","V")+Foreign("^NYSEBR","\
I"));

Cond2=Foreign("^NYSEBR","I")/(Foreign("^NYSEBR","V")+Foreign("^NYSEBR","\
I"));

Cond2A=Foreign("GSPC","V",1)>EMA(Foreign("GSPC","V",1),50);

Buy=Cond1>.89 OR Cond1>.79 AND Ref(Cond1,-1)>.79 AND Cond2A;

Sell=Cond2>.89 AND Cond2A;

shape=Buy*shapeUpArrow+Sell*shapeDownArrow;

PlotShapes(shape,IIf(Buy,colorSeaGreen,colorRed),0,IIf(Buy,Low,High));





Reply via email to