Financial Time Series Toolbox | ![]() ![]() |
Syntax
[mid, uppr, lowr] = bollinger(data, wsize, wts, nstd) [midfts, upprfts, lowrfts] = bollinger(tsobj, wsize, wts, nstd)
Arguments
Description
[mid, uppr, lowr] = bollinger(data, wsize, wts, nstd)
calculates the middle, upper, and lower bands that make up the Bollinger bands from the vector data
.
mid
is the vector that represents the middle band, a simple moving average with default window size of 20. uppr
and lowr
are vectors that represent the upper and lower bands. These bands are +2 times and -2 times moving standard deviations away from the middle band.
[midfts, upprfts, lowrfts] = bollinger(tsobj, wsize, wts, nstd)
calculates the middle, upper, and lower bands that make up the Bollinger bands from a financial time series object tsobj
.
midfts
is a financial time series object that represents the middle band for all series in tsobj
. Both upprfts
and lowrfts
are financial time series objects that represent the upper and lower bands of all series, which are +2 times and -2 times moving standard deviations away from the middle band.
Examples
Compute the Bollinger bands for Disney stock closing prices and plot the results:
load disney.mat [dis_Mid,dis_Uppr,dis_Lowr]= bollinger(dis); dis_CloseBolling = [dis_Mid.CLOSE, dis_Uppr.CLOSE,... dis_Lowr.CLOSE]; plot(dis_CloseBolling) title('Bollinger Bands for Disney Closing Prices')
See Also
Reference
Achelis, Steven B., Technical Analysis from A To Z, Second printing, McGraw-Hill, 1995, pp. 72 - 74.
![]() | bar3, bar3h | boxcox | ![]() |