- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
This is the basic %b formula:
%b = (close – lower band) / (Upper band – lower band)
For the basic %b formula, we multiply the %b result with 100 to get an oscillator moving between 0 and 100 (with overshoots):
{The upper band}
upper:=2*Stdev( CLOSE,20 ) + Mov(CLOSE,20,SIMPLE);
{The lower band}
lower:=Mov(CLOSE,20,SIMPLE)-2*Stdev( CLOSE,20);
{%b}
percb:=(C-lower)/(upper-lower)*100;
percb
Applying some math we can simplify the formula with the following result for the basic (MetaStock) formula for a Bollinger Bands %b indicator using closing prices and a simple moving average:
{BB%b_C_S}
percb:=(C+2*Stdev(C,20)-Mov(C,20,S))/(4*Stdev(C,20))*100;
percb
kaynak
http://stocata.org/
%b = (close – lower band) / (Upper band – lower band)
For the basic %b formula, we multiply the %b result with 100 to get an oscillator moving between 0 and 100 (with overshoots):
{The upper band}
upper:=2*Stdev( CLOSE,20 ) + Mov(CLOSE,20,SIMPLE);
{The lower band}
lower:=Mov(CLOSE,20,SIMPLE)-2*Stdev( CLOSE,20);
{%b}
percb:=(C-lower)/(upper-lower)*100;
percb
Applying some math we can simplify the formula with the following result for the basic (MetaStock) formula for a Bollinger Bands %b indicator using closing prices and a simple moving average:
{BB%b_C_S}
percb:=(C+2*Stdev(C,20)-Mov(C,20,S))/(4*Stdev(C,20))*100;
percb
This is the modified SVE_BB%b formula:
Kod:
{Sylvain Vervoort SVE_BB%b}
period:=Input("%b period: ",1,100,18);
TeAv:=Input("Tema average: ",1,30,8);
afwh:= Input("Standard deviation high ",.1,5,1.6);
afwl:= Input("Standard deviation Low ",.1,5,1.6);
afwper:= Input("Standard deviation period ",1,200,63);
haOpen:=(Ref((O+H+L+C)/4,-1) + PREV)/2;
haC:=((O+H+L+C)/4+haOpen+Max(H,haOpen)+Min(L,haOpen))/4;
TMA1:= Tema(haC,TeAv);
TMA2:= Tema(TMA1,TeAv);
Diff:= TMA1 - TMA2;
ZlHA:= TMA1 + Diff;
percb:=(Tema(ZLHA,TeAv)+2*Stdev(Tema(ZLHA,TeAv),period)- Mov(Tema(ZLHA,TeAv),period,WEIGHTED))/(4*Stdev(Tema(ZLHA,TeAv),period))*100;
percb;
50+afwh*Stdev(percb,afwper);
50-afwl*Stdev(percb,afwper);
50
http://stocata.org/