[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Bollinger Squeeze Code - improvable?



PureBytes Links

Trading Reference Links

Thanks very much, Andrew. Your code is something I've long wanted to 
investigate. Can you tell me what changes would be necessary to use it as a 
"filter" in an exploration? For the moment, I'd be interested in the code 
for long entries.

Philip

>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
>ADVERTISEMENT
><http://us.ard.yahoo.com/SIG=129tpolqd/M=295196.4901138.6071305.3001176/D=groups/S=1705375617:HM/EXP=1089480708/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com>
>click here
>
>[]
>
>
>
>----------
>Yahoo! Groups Links
>    * To visit your group on the web, go to:
>    * 
> <http://groups.yahoo.com/group/equismetastock/>http://groups.yahoo.com/group/equismetastock/ 
>
>    *
>    * To unsubscribe from this group, send an email to:
>    * 
> <mailto:equismetastock-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>equismetastock-unsubscribe@xxxxxxxxxxxxxxx 
>
>    *
>    * Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.





------------------------ 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/