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

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

I want to insert "Bollinger Bands Width"

Postby cktsui888 » 29 Mar 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: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

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

Postby ABC » 29 Mar 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: 22 Mar 2017
Has thanked: 1 time

Re: I want to insert "Bollinger Bands Width"

Postby cktsui888 » 05 Apr 2017

Thanks


Return to “MultiCharts”