Skip to contents

[Experimental]

Bollinger Bands provide a visual representation of price volatility and are widely used by traders and investors to assess potential price reversals and trade opportunities in various financial markets, including stocks, forex, and commodities.

Usage

addBBands(chart, cols = c("High", "Low", "Close"), ...)

Arguments

chart

a kline() or ohlc() chart

cols

a vector of column names used to calculate the Bollinger Bands Default values High, Low and Close

...

See TTR::BBands()

Value

Invisbly returns a plotly object.

See also

Other chart indicators: addEvents(), addFGIndex(), addLSRatio(), addMACD(), addMA(), addRSI(), addVolume(), chart()

Examples

# script: scr_charting
# date: 2023-10-25
# author: Serkan Korkmaz, serkor1@duck.com
# objective: Charting in general
# script start;

# library
library(cryptoQuotes)

# charting klines
# with various indicators
chart(
  chart = kline(
    ATOMUSDT
  ) %>% addVolume() %>% addMA(
    FUN = TTR::SMA,
    n = 7
  ) %>% addMA(
    FUN = TTR::SMA,
    n = 14
  ) %>%
    addBBands() %>%
    addMACD() %>%
    addRSI()

)
# script end;