I want to insert "Bollinger Bands Width" [SOLVED]
I want to insert "Bollinger Bands Width"
I only see "Bollinger Bands" in insert study. I want to insert "Bollinger Bands Width" . Which study I should use? Thanks!
- 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]
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.
Regards,
ABC
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 ;
ABC