# Volatility and Bollinger Bands

February 13, 2016
By

(This article was first published on R – Quintuitive, and kindly contributed to R-bloggers)

It is a common knowledge that Bollinger Bands (price standard deviation added to a moving average of the price) are an indicator for volatility. Expanding bands – higher volatility, squeezing bands – lower volatility. A bit of googling and you get the idea. In my opinion – that’s wrong, unless, one uses a twisted definition of volatility.

Let’s consider two possible scenarios:

• Prices go up 1% for 10 days in a row.
• Prices go up 1%, down 1% for the same 10 days.

Which one is more volatile in your opinion? What do you think is the conclusion based on Bollinger Bands indicator?

Looking at the figure above, it’s clear that according to our indicator, the volatility is way higher in the first scenario. The figure also reveals the reason – the standard deviation is simply the squared distances from the mean. In the first case, the squares of the large distances over the beginning and the ending of the period add a lot. All in all – exactly the opposite conclusion of what I would have thought – I would prefer my indicator to determine that the volatility is higher in the second case. I can settle for the volatility being approximately the same. But a factor of six is way too much:

```aa = rep(1, 10)
for(ii in 2:10) aa[ii] = aa[ii-1]*1.01
aa
# 1.000000 1.010000 1.020100 1.030301 1.040604 1.051010 1.061520 1.072135 1.082857 1.093685

bb = rep(1,10)
for(ii in 2:10) bb[ii] = bb[ii-1]*(1+0.01*(-1)^ii)
bb
# 1.0000000 1.0100000 0.9999000 1.0098990 0.9998000 1.0097980 0.9997000 1.0096970 0.9996001 1.0095961

sd(aa)
# 0.03151583

sd(bb)
# 0.005271538
```

Pretty clear – when prices don’t go too far from the mean (the second case), the bands contract.

The reason for this behavior is that the price series is not stationary:

I am not saying Bollinger bands are useless. They could be used to determine ranging prices (contraction in the bands without significant contraction in the returns). Or to define some extreme profit targets (in strong trends the Bollinger bands widen a lot, thus, taking profits once a widened Bollinger band is touched makes sense). Yes, they are useful, just not for the purpose they are usually advertised for.

The post Volatility and Bollinger Bands appeared first on Quintuitive.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...