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

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



PureBytes Links

Trading Reference Links

Philip

For a quick and dirty you can just put the following into the filter tab -
it's the same formula without the input options and stopping at EL. Some of
the lines are redundant in Explorer, but it does the job for a quickie.
Next step would be to throw in an Alert() formula so that the signal stays
in place for a few days.

I would note that my backtesting on this has been disappointing. Low win%,
low profitability and big drawdowns. It may do better with the parabolic
exit that Bollinger talks about.

If you look at this you can also excerpt the formulas for indicators for the
bands themselves, %b, and bandwidth, so you can check the system is working
by visual inspection.

Happy hunting
Andrew


------------------------------------------------------------

TypPrice:=(O+H+L+C)/4;
MA:=Mov(TypPrice,20,S);
BBTop:=MA+2*( Stdev(TypPrice, 20));
BBBottom:=MA-2*( Stdev(TypPrice, 20)) ;
Bandwidth:=(BBTop - BBBottom)/MA;

Bpct:=(TypPrice - BBBottom)/(BBTop-BBBottom);
WidthLow:=LLV(Ref(Bandwidth,-1),120);

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);
EL


-----Original Message-----
From: Philip Schmitz [mailto:pschmi02@xxxxxxxxxxx] 
Sent: Friday, July 09, 2004 4:44 PM
To: equismetastock@xxxxxxxxxxxxxxx
Subject: Re: [EquisMetaStock Group] Bollinger Squeeze Code - improvable?


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>equis
metastock-unsubscribe@xxxxxxxxxxxxxxx 
>
>    *
>    * Your use of Yahoo! Groups is subject to the
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.






 
Yahoo! Groups Links



 




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