BBand with EMA (vs SMA) to reduce lag
Author: kbellare
Creation Date: 2/23/2014 9:17 PM
profile picture


Is there a BBands function that uses EMA instead of SMA to construct the Bollinger bands?
The typical BBand(Close,per) calculates the SMA(per) and adds Bands(+/- N.stdev) around the SMA, but this has lag. Would like to reduce the lag by using EMA.

If not, please provide sample code that would generate such a Data Series.

profile picture


To quote the Wiki online manual, Bollinger Bands are envelopes that are plotted at a standard deviation level above and below a simple moving average of the price. Create a EMA series and a StdDev series, then two more Bands which add or subtract desired number of StdDevs from the mean. And there you have it. For the sample code on EMA/StdDev, please refer to the Wiki.