Skip to contents

[Experimental]

A high-level plotly::add_lines()-wrapper function that interacts with the TTR::BBands()-function. The function adds bollinger bands to the main chart().

Usage

bollinger_bands(
   n = 20,
   sd = 2,
   maType = "SMA",
   color  = '#F100F1',
   ...
)

Arguments

n

Number of periods for moving average.

sd

The number of standard deviations to use.

maType

A function or a string naming the function to be called.

color

A character-vector of length 1. "#F100F1" by default.

...

Other arguments to be passed to the maType function.

Value

An invisible

plotly::plot_ly()-object.

See also

Other chart indicators: add_event(), alma(), chart(), dema(), ema(), evwma(), fgi(), hma(), lsr(), macd(), rsi(), sma(), volume(), vwap(), wma(), zlema()

Other main chart indicators: add_event(), alma(), dema(), ema(), evwma(), hma(), sma(), vwap(), wma(), zlema()

Author

Serkan Korkmaz

Examples

# script start;

# Charting BTC using
# candlesticks as main
# chart
cryptoQuotes::chart(
  ticker = BTC,
  main   = cryptoQuotes::kline(),
  sub    = list(
    cryptoQuotes::volume()
  )
)
# script end;