I want to insert "Bollinger Bands Width" [SOLVED]
- ABC
- Posts: 731
- Joined: Dec 16 2006
- Location: www.abctradinggroup.com
- Has thanked: 126 times
- Been thanked: 415 times
- Contact:
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