Site icon R-bloggers

Volatility and Bollinger Bands

[This article was first published on R – Quintuitive, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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:

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.

To leave a comment for the author, please follow the link and comment on their blog: R – Quintuitive.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.