Professional Documents
Culture Documents
28-Smoothing The Bollinger
28-Smoothing The Bollinger
CHRISTINE MORRISON
clear turning points that will help traders identify entry and for displaying Bollinger bands. Here is the MetaStock formula
exit points while prices are moving between the Bollinger for Bollinger bands using basic functions:
bands.
{The middle band}
by Sylvain Vervoort Mov(Close,20,Simple);
B
{The upper band}
y now, everybody in the business knows that Bol- 2*Stdev(Close,20 ) + Mov(Close,20,Simple);
linger bands were developed by John Bollinger. {The lower band}
What they actually are is probably equally known. Mov(Close,20,Simple)-2*Stdev(Close,20)
The Bollinger bands in Figure 1 consist of a set of
three curves drawn in relation to price data. The In a normal distribution, most prices of a set of data are close
middle band is usually a simple 20-bar moving average that to the average, with relatively few prices moving in one extreme
serves as the base for the upper and lower bands. or the other. If you were to look at a normally distributed data
on a graph, it would look like a bell curve. Not all price data
Upper band = Middle band + 2 x 20-period closing prices will reflect a perfect curve, of course. The standard deviation
standard deviation of the 20-period closing prices is a statistic that tells you how
tight the price data are clustered around the mean.
Lower band = Middle band – 2 x 20-period closing prices
The standard deviation of the moving average is a method
standard deviation
used to measure price volatility. With trending prices, the bands
will be wider as a result of the higher volatility in price, mov-
Copyright (c) Technical Analysis Inc.
Stocks & Commodities V. 28:5 (40-44): Smoothing The Bollinger %b by Sylvain Vervoort
indicators 26
25
24
23
ing farther away from the mean, whereas
during consolidation periods, bands tend
22
to be narrower as a result of smaller price 21
moves closer to the mean. This changing 20
bandwidth is used for volatility-based 19
trading opportunities. 18
%b is a measure of where prices are 17
in relation to the outer Bollinger bands 16
and therefore strongly related to volatil- 15
ity. %b was created as an oscillator to 14
show overbought and oversold situations 13
when price is moving close to or beyond 12
the upper or lower Bollinger bands. The
METASTOCK
basic %b formula is: March April May June July August
Figure 1: BOLLINGER BANDS. Bollinger bands consist of three curves drawn in relation to price data. The middle
(Close – Lower band) band is usually a 20-bar simple moving average that serves as the base for the upper and lower bands.
%b =
(Upper band – Lower band)
In Figure 3, you can see the price chart of Gaia at the top You can see the result in Figure 3 displayed as “BB%b_
and the basic closing prices %b indicator (BB%b_C) displayed step2.”
on the bottom subchart.
Step 3:
Step 1: So far, so good. However, I would like to see more smoothing
A good basic smoothing technique that creates a very small delay and, of course, minimal or no lag. What I can do is smooth the
is the heikin-ashi recalculated prices. The heikin-ashi is a Japa- standard deviation bands with Tema. And instead of using the
nese charting technique, detailed in a Stocks & Commodities simple moving average for the referenced middle band, I can
article in February 2004. I am using my own average heikin-ashi use a faster exponential moving average (Ema) or a weighted
closing price “haC,” which is calculated as follows: moving average (Wma). I prefer the Wma because it tends to
move more smoothly than the Ema.
haOpen:=(Ref((O+H+L+C)/4,-1) + PREV)/2; I can also bring down the averaging period as long as the
haC:=((O+H+L+C)/4+haOpen+Max(H,haOpen)+Min(L,haO smoothing is acceptable. This is why I use an 18-period av-
pen))/4; erage instead of the standard 20-period average in the next
formula.
You can use this haC closing price instead of the normal Introducing these additional changes results in the follow-
closing price in the previous basic formula: ing:
9.0
8.5
8.0
7.5
7.0
agree that it looks a lot less choppy and that 1 6.5
6.0
delays are most likely not a problem, espe- 5.5
cially because the %b is a leading indicator 2 5.0
4.5
and tends to usually be fast. 4.0
3.5
3.0
Step 4: 2.5
In this, the final step, I make the Wma and the
3 2.0
1.5
Tema adjustable and instead of using fixed 1 2
reference lines at, for example, zero, 50, and
100, I use standard deviation lines with 1.6
50
standard deviations as the default over a look-
back period of 63 days. The final Sve_BB%b
code for MetaStock can be found in sidebar
“MetaStock Code For Sve_BB%b.” 3 0
3 10 17 24 1 8 15 22 29 5 12 20 26 2 9 17 23 2 9
Applying the indicator
November December 2009 February March
Using the chart of Gaia as an example, FIGURE 4: PRICE DROP. In November, there was a big price drop and some recuperation. After that, price
I will show you how basically to use this started moving further downward with a very gentle slope. Note the convergences and divergences between
indicator. Keep in mind I will introduce a the price and indicator.
trading system using this indicator in part
2 of this series.
I have split the chart of Gaia into two parts. Figure 4 is The SVE_BB% is often a leading
the first part ended March 9, 2009. In November there was a indicator with clear turning points.
big price drop and some recuperation. After that, price started
moving further down in a very gentle slope. What does the Prices continue on their downward move until the middle
Sve_BB%b indicator tell you about that period? of February 2009. In phase 2, you see a similar situation as in
In Figure 4, you can see the big price drop in November phase 1, where there are lower tops in price and higher tops
2008 as well as the reaction to the drop, which went on until in the indicator. This is another hidden divergence telling you
the beginning of December 2008. This was a convergent move that price will continue its down move. In phase 3, price is
with lower tops in price and the indicator. During phase 1, the making lower lows, but now the indicator is making higher
price continued its down move, making a lower top in price. lows. This is a normal divergence telling you that you should
But the indicator makes a higher top at the beginning of Janu- expect the price to move up.
ary 2009. This is an inverse or hidden divergence pointing to Note the dojis in the candlestick chart where price is bot-
a continuation of the previous downtrend. toming. In addition, note that the price has been moving within
narrow Bollinger bands, indicating low volatility for more
MetaStock Code For SVE_BB%b than three months already.
Clearly, you can open a position here with a very good
period:=Input(“%b period: “,1,100,18);
risk-to-reward ratio, with a buy at $2.53 and an initial closing
TeAv:=Input(“Tema average: “,1,30,8);
price stop at $2.38. This is an ideal entry for opening a long
afwh:= Input(“Standard deviation high “,.1,5,1.6);
position with a risk of only 6%.
afwl:= Input(“Standard deviation Low “,.1,5,1.6);
Let’s continue with Figure 5, the second part of the chart of
afwper:= Input(“Standard deviation period “,1,200,63);
Gaia. Phase 3 actually brought a trend reversal and started a
haOpen:=(Ref((O+H+L+C)/4,-1) + PREV)/2;
new price up move. There is a nice convergent up move until
haC:=((O+H+L+C)/4+haOpen+Max(H,haOpen)+Min(L,haOp
early May 2009. At phase 4, you see a negative divergence
en))/4;
with higher tops in price but lower tops in the indicator. This
TMA1:= Tema(haC,TeAv);
suggests an upcoming price reversal.
TMA2:= Tema(TMA1,TeAv);
Seems like a good time to take the more than 100% profit!
Diff:= TMA1 - TMA2;
What follows is a correction back to the lower Bollinger
ZlHA:= TMA1 + Diff;
band. The end of this correction (phase 5) is showing a posi-
percb:=(Tema(ZLHA,TeAv)+2*Stdev(Tema(ZLHA,TeAv),period)-
tive divergence with lower lows in price and higher lows in
Mov(Tema(ZLHA,TeAv),period,WEIGHTED))/(4*Stdev(Tema(
the indicator. This pushes prices up again. You could go for
ZLHA,TeAv),period))*100;
a new long position here. The tops in price and indicator at
percb;
the beginning of June, or end of phase 6, show a negative
50+afwh*Stdev(percb,afwper);
divergence, which pushes prices down for a bigger correc-
50-afwl*Stdev(percb,afwper);
tion. It now looks like prices have reached the end of this
50
correction and there is a new positive divergence in phase 7.
Copyright (c) Technical Analysis Inc.
Stocks & Commodities V. 28:5 (40-44): Smoothing The Bollinger %b by Sylvain Vervoort
7.0 indicators
6
6.5
4 6.0
5.5 Belgium-based Sylvain Vervoort is a
5.0 retired electronics engineer who has
5 4.5 been using technical analysis for more
7 than 30 years. His book, Capturing
4.0
Profit With Technical Analysis, pub-
3.5 lished by Marketplace Books, is now
3.0 available. Vervoort may be reached
2.5 at sve.vervoort@scarlet.be or via his
6 website, http://stocata.org.
3 4 100
Suggested reading
Bollinger, John [2001]. Bollinger On
50
Bollinger Bands, McGraw-Hill.
Mulloy, Patrick [1994]. “Smooth-
5 0 ing Data With Less Lag,” Technical
3 9 16 23 30 6 13 20 27 4 11 18 26 1 8 15 22 297 6 1 Analysis of Stocks & Commodities,
March April May June July Volume 12: February.
FIGURE 5: THE UP MOVE. Here you see a new price up move. There is a nice convergent up move until early May Sharp, Joe [2000]. “More Respon-
2009. After that, you see a negative divergence between price and indicator suggesting a trend reversal. Note the sive Moving Averages,” Technical
relationship between price moves and the indicator during the entire correction. Analysis of Stocks & Commodities,
Volume 18: January.
Interestingly, at the beginning of October 2009, the price of Valcu, Dan [2004]. “Using The Heikin-Ashi Technique,”
Gaia went up to about $8. Technical Analysis of Stocks & Commodities, Volume
22: February.
Conclusion Vervoort, Sylvain [2008]. “Trading Medium-Term Diver-
The Sve_BB%b is often a leading indicator making smooth gences,” Technical Analysis of Stocks & Commodities,
moves with clear turning points. Normal and hidden divergent Volume 26: February.
moves make it an ideal tool to help find entry and exit points _____ [2009]. Capturing Profit With Technical Analysis,
while watching price moving between the Bollinger bands. I Marketplace Books.
find it easier to use than the original %b indicator.
In the second article of this series, I will introduce a good
trading system using the Sve_BB%b indicator and include S&C
some ideas together with other technical analysis tools. Stay
tuned!