| Financial Toolbox | Search  Help Desk |
| bolling | Examples See Also |
Syntax
bolling(asset, samples, alpha) [mav, uband, lband] = bolling(asset, samples, alpha)
Description
bolling(asset, samples, alpha)
plots Bollinger bands for given asset data. samples specifies the number of samples to use in computing the moving average. alpha is the exponent used to compute the element weights of the moving average. This form of the function does not return any data.
[mav, uband, lband] = bolling(asset, samples, alpha)
returns mav with the moving average of the asset data, uband with the upper band data, and lband with the lower band data. This form of the function does not plot any data.
Examples
Ifasset is an N-by-1 vector of closing stock prices:
bolling(asset, 20, 1)plots linear 20-day moving average Bollinger bands based on the stock prices.
[mav, uband, lband] = bolling(asset, 20, 1)returns
mav, uband, and lband as (N-19)-by-1 vectors containing the moving average, upper band, and lower band data, without plotting the data.
See Also
candle, dateaxis, highlow, movavg, pointfig