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

[amibroker] Better Bollinger Bands



PureBytes Links

Trading Reference Links

In an article in Futures Magazine, October 1998, Dennis McNicholl describesthe use of Bollinger Bands and provides a means of making them tighter whenmarkets are trending. He calls them Better Bollinger Bands.

Here is the formula for MetaStock. Please help me convert to AFL Code.


Better Bollinger Bands I

pds:=Input("Periods",2,200,20);
sd:=Input("Standard Deviations",.01,10,2);
alpha:=2/(pds+1);
mt:=alpha*C+(1-alpha)*(If(Cum(1)<pds,C,PREV));
ut:=alpha*mt+(1-alpha)*(If(Cum(1)<pds,C,PREV));
dt:=((2-alpha)*mt-ut)/(1-alpha);
mt2:=alpha*Abs(C-dt)+(1-alpha)*PREV;
ut2:=alpha*mt2+(1-alpha)*PREV;
dt2:=((2-alpha)*mt2-ut2)/(1-alpha);
but:=dt+sd*dt2;
blt:=dt-sd*dt2;
dt;
but;
blt


Better Bollinger Bands II

Lb:=Input("Look-Back Period ?",3,100,20);
De:=Input("Band Deviation ?",.5,3,2);
Alp:=2/(Lb+1);
Mt:=Alp*CLOSE+(1-Alp)*PREV;
Ut:=Alp*Mt+(1-Alp)*PREV;
Dt:=((2-Alp)*Mt-Ut)/(1-Alp);
mt2:=Alp*Abs(C-Dt)+(1-Alp)*PREV;
ut2:=Alp*mt2+(1-alp)*PREV;
dt2:=((2-Alp)*mt2-ut2)/(1-Alp);
But:=Dt+de*dt2;
Blt:=Dt-de*dt2;
But;
Dt;
Blt;


__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___