## Bollinger Bands - Percentage and Bandwidth

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

### Bollinger Bands - Percentage and Bandwidth

Hello,

These are 2 additions to Bollinger Bands indicator:

1. Bollinger Bands - Percentage (Line)
Formula: b% = ((close - lower band) / (upper band - lower band)) * 100

NOTE There is NEW version or %B indicator.
BB-Percentages.lua

2. Bollinger Bands - Bandwidth (Histogram/Bar)
Formula: Bandwidth = ((upper band - lower band) / middle band)
BB-Bandwidth.lua

These two and original Bollinger Bands from MarketScope, can be ran together for best effect.

Here is a screenshot of % and bandwidth running:
Bollinger Bands: Percentage and Bandwidth, two indicators at the same time in MarketScope.

Buy/Sell signals (provided by fxcodebase.com user):
Buy Signal - Bollinger Percent = 0 (<0.1)
Sell Signal - Bollinger Percent = 1 (>0.9)

Detailed Description of Bollinger Bands can be found here at their official website:
http://www.bollingerbands.com/services/bb/
Best Regards,

"TonyMod"
(FXCodeBase.com Forum Moderator)
TonyMod

Posts: 70
Joined: Wed Oct 21, 2009 1:57 pm
Location: New Jersey

### Re: Bollinger Bands - Percentage and Bandwidth

Thanks for the effort, as far as I can see, Bollinger Percentages (% B) corresponds to the specification, I gave.
I have two suggestions, would be helpful to add line a line at 0.5 and 1 (50 and 100 percent).

Apprentice
FXCodeBase: Confirmed User

Posts: 19439
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Bollinger Bands - Percentage and Bandwidth

Apprentice wrote:Thanks for the effort, as far as I can see, Bollinger Percentages (% B) corresponds to the specification, I gave.
I have two suggestions, would be helpful to add line a line at 0.5 and 1 (50 and 100 percent).

Good, i'm really glad our work is useful to people. Let me know if anything needs to be fixed or changed, tweaked, etc....

As far as adding lines, yes its possible to do using an indicator, but doesn't MarketScope allow adding of any type of lines user desires right on top of the chart?
Best Regards,

"TonyMod"
(FXCodeBase.com Forum Moderator)
TonyMod

Posts: 70
Joined: Wed Oct 21, 2009 1:57 pm
Location: New Jersey

### Re: Bollinger Bands - Percentage and Bandwidth

you're right, I'm a little lazy

Apprentice
FXCodeBase: Confirmed User

Posts: 19439
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Bollinger Bands - Percentage and Bandwidth

There is a little extension of BBW oscillator

Bollinger Bandswidth oscillator would help to measure price plot’s volatility; it shows result as a width of Bollinger Bands in times, points or price %. Technically speaking Bollinger Bandswidth is a standard deviation of price movement multiplied by [some] number of deviations.

When the BBW is close to 0 it shows low volatility and when it moves to its high levels volatility is high. You have to understand that width of Bollinger Bands is VERY depend on time frame; so you have to setup range levels of the oscillator every time when you change the time frame. Default levels (0.28-1.4) are good for BB(5min,75,2) only.

As a rule, volatility moves in cycles - periods of low volatility are replaced by periods of high volatility. In general, periods of high volatility can be noted during down-trends and corrections downward. Periods of low volatility can be observed during up-trends and recoveries.

Also this nutty oscillator could help to filter out a noise of insufficient signals producing by some indicators (like Volty Channel Stop) in low volatile market.

Attached 2 versions of Oscillator: single time frame and bigger time frame.
Attachments
bb_width.lua
current timeframe
BF_BB_Width.lua
bigger timeframe
how it looks like
skipper
FXCodeBase: Confirmed User

Posts: 2
Joined: Tue Nov 16, 2010 5:33 pm

### Re: Bollinger Bands - Percentage and Bandwidth

Hello,

I would like to ask is it possible to change/tweak this indicator a bit with showing it like a histogram or otherwise tell me how to add lines to this indicator itself so I can later remove/add this indicator with the lines I setup before ... if this is possible?

Thanks
nookie
FXCodeBase: Initiate

Posts: 199
Joined: Tue May 24, 2011 12:50 pm

### Re: Bollinger Bands - Percentage and Bandwidth

Like This.
BB-Percentages.lua

Simply replacing core.Line with core.Bar.
When you define indicator output stream.

Apprentice
FXCodeBase: Confirmed User

Posts: 19439
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Bollinger Bands - Percentage and Bandwidth

Sorry again for bothering but how is it possible to add lines to this indicator and with different colours.. for example lines on levels 100 and 0 ?

Thanks a lot

nookie
nookie
FXCodeBase: Initiate

Posts: 199
Joined: Tue May 24, 2011 12:50 pm

### Re: Bollinger Bands - Percentage and Bandwidth

I'll try to write something.

Apprentice
FXCodeBase: Confirmed User

Posts: 19439
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Bollinger Bands - Percentage and Bandwidth

Style Option Added to Bollinger Band - Percentage Oscillator

Apprentice
FXCodeBase: Confirmed User

Posts: 19439
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Next