PureBytes Links
Trading Reference Links
|
Attached is my code for the Bollinger Squeeze methodology (Method 1 in the
book). Entry on first band breakout after 6 month bandwidth low, exit on
opposite band tag, based on adjusted typical price (i.e. (O+H+L+C)/4, which
Bollinger seems to favor). It seems to work, and no PREV functions to slow
it down. It includes many borrowings from Roy and Jose, but it's
shortcomings are mine, not theirs! Does anyone have any suggestions as to
how to improve it? If anyone bought the add-in, I'd be interested in hearing
how it stacks up.
Andrew
----------------------------------------------------------------------------
-----------------------------------------------
{Bollinger Method I. Entry and exit on band breakout following bandwidth
squeeze, no stops. Using adjusted typical price. Thanks to Roy and Jose for
several key details}
P1:=Input("No of bars:",1,200,20);
P2:=Input("STD multiple",0.5,6,2);
P3:=Input("Lookback bars",2,300,120);
TypPrice:=(O+H+L+C)/4;
MA:=Mov(TypPrice,P1,S);
BBTop:=MA+P2*( Stdev(TypPrice, P1));
BBBottom:=MA-P2*( Stdev(TypPrice, P1)) ;
Bandwidth:=(BBTop - BBBottom)/MA;
Bpct:=(TypPrice - BBBottom)/(BBTop-BBBottom);
WidthLow:=LLV(Ref(Bandwidth,-1),P3);
NewLo:= cross(WidthLow,Bandwidth);
LoBpct:= cross(0,Bpct);
HiBpct:= cross(Bpct,1);
Init:=Cum(LoBpct+HiBpct+NewLo>-1)=1;
TriggerL:=BarsSince(Init OR NewLo)
<BarsSince(Init OR LoBpct)+(Cum(LoBpct)=1);
EL:= IF(TriggerL,HiBpct,0);
long:= BarsSince(Init OR EL)
< BarsSince(Init OR LoBpct)
+(Cum(LoBpct)=1);
TriggerS:=BarsSince(Init OR NewLo)
<BarsSince(Init OR HiBpct)+(Cum(HiBpct)=1);
ES:= IF(TriggerS,LoBpct,0);
short:=BarsSince(Init OR ES)
<BarsSince(Init OR HiBpct)
+(Cum(HiBpct)=1);
long - short
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|