View Single Post
  #1 (permalink)  
Old 02-13-2006, 02:38 PM
forextrades forextrades is offline
Banned
 
Join Date: Dec 2005
Posts: 61
forextrades is on a distinguished road
Better Bollinger Bands...

This is the Metastock code for an indicator called Better Bollinger Bands. Can anyone code it in MT4? Any help would be appreciated.

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
Reply With Quote