Page 1 of 1

I want to insert "Bollinger Bands Width"

Posted: Mar 29 2017
by cktsui888
I only see "Bollinger Bands" in insert study. I want to insert "Bollinger Bands Width" . Which study I should use? Thanks!

Re: I want to insert "Bollinger Bands Width"  [SOLVED]

Posted: Mar 29 2017
by ABC
cktsui888,

as far as I am aware there is no build in study for the Bollinger Width, but you can accomplish this with a quick modification of the build in Bollinger Bands indicator.

Code: Select all

inputs:
BollingerPrice ( Close ),
Length ( 20 ),
NumDevsUp ( 2 ),
NumDevsDn ( -2 ),
Displace ( 0 ) ;

variables:
midLine ( 0 ),
vStdDev ( 0 ),
bbWidth ( 0 ),
upperBand ( 0 ),
lowerBand ( 0 ) ;

midLine = AverageFC( BollingerPrice, Length ) ;
vStdDev = StandardDev( BollingerPrice, Length, 1 ) ;
upperBand = midLine + NumDevsUp * vStdDev ;
lowerBand = midLine + NumDevsDn * vStdDev ;

bbWidth = upperBand - lowerBand ;

if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
Plot1[Displace]( bbWidth, "BB Width" ) ;
end ;
Regards,

ABC

Re: I want to insert "Bollinger Bands Width"

Posted: Apr 05 2017
by cktsui888
Thanks