Financial Toolbox | ![]() ![]() |
Syntax
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.
[Movavgv, UpperBand, LowerBand] = bolling(Asset, Samples, Alpha)
returns Movavgv
with the moving average of the Asset
data, UpperBand
with the upper band data, and LowerBand
with the lower band data. This form of the function does not plot any data.
Examples
If Asset is a column vector of closing stock prices
plots linear 20-day moving average Bollinger bands based on the stock prices.
returns Movavgv
, UpperBand
, and LowerBand
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
![]() | bndyield | busdate | ![]() |