Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

addBBands

Add Bollinger Bands to Chart


Description

Add Bollinger Bands to current chart.

Usage

addBBands(n = 20, sd = 2, maType = "SMA", draw = 'bands', on = -1)

Arguments

n

number of moving average periods

maType

type of moving average to be used

sd

number of standard deviations

draw

indicator to draw: bands, percent, or width

on

which figure area of chart to apply to

Details

The primary addition to this function call over the TTR version is in the draw argument. ‘bands’ will draw standard Bollinger Bands, ‘percent’ will draw Bollinger %b and ‘width’ will draw Bolinger Bands Width. The last two will be drawn in new figure regions.

See bollingerBands in TTR for specific details as to implementation and references.

Value

Bollinger Bands will be drawn, or scheduled to be drawn, on the current chart. If draw is either percent or width a new figure will be added to the current TA figures charted.

A chobTA object will be returned silently.

Author(s)

Jeffrey A. Ryan

References

See bollingerBands in TTR written by Josh Ulrich

See Also

Examples

## Not run: 
addBBands()

## End(Not run)

quantmod

Quantitative Financial Modelling Framework

v0.4.18
GPL-3
Authors
Jeffrey A. Ryan [aut, cph], Joshua M. Ulrich [cre, aut], Wouter Thielen [ctb], Paul Teetor [ctb], Steve Bronder [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.