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

Questions about MultiCharts and user contributed studies.
cktsui888
Posts: 11
Joined: Mar 22 2017
Has thanked: 1 time

Mar 29 2017

I only see "Bollinger Bands" in insert study. I want to insert "Bollinger Bands Width" . Which study I should use? Thanks!

User avatar
ABC
Posts: 731
Joined: Dec 16 2006
Location: www.abctradinggroup.com
Has thanked: 126 times
Been thanked: 415 times
Contact:

Mar 29 2017

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

cktsui888
Posts: 11
Joined: Mar 22 2017
Has thanked: 1 time

Apr 05 2017

Thanks