Skip to contents

[Experimental]

Traders and investors use the MACD indicator to identify trend changes, potential reversals, and overbought or oversold conditions in the market. It is a versatile tool that can be applied to various timeframes and asset classes, making it a valuable part of technical analysis for many traders.

Usage

addMACD(chart, ...)

Arguments

chart

a kline() or ohlc() chart

...

See TTR::MACD()

Value

Invisbly returns a plotly object.

See also

Other chart indicators: addBBands(), addEvents(), addFGIndex(), addLSRatio(), 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;