zlema {cryptoQuotes}R Documentation

Add Zero Lag Exponential Moving Average to the chart

Description

[Experimental]

A high-level plotly::add_lines()-wrapper function that interacts with TTR's moving average family of functions.

Usage

zlema(price = "close", n = 10, ratio = NULL, internal = list(), ...)

Arguments

price

A character-vector of length 1. Close by default. The name of the vector to passed into TTR::ZLEMA

n

Number of periods to average over. Must be between 1 and nrow(x), inclusive.

ratio

A smoothing/decay ratio. ratio overrides wilder in EMA.

internal

An empty list. Used for internal purposes. Ignore.

...

any other passthrough parameters

Value

A plotly::plot_ly()-object wrapped in rlang::expr().

See Also

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

Other moving average indicators: alma(), dema(), ema(), evwma(), hma(), sma(), wma()

Examples

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

## charting the klines
## with indicators as
## subcharts
chart(
  ticker     = BTC,
  main       = kline(),
  sub        = list(
    volume(),
    macd()
  ),
  indicator = list(
    bollinger_bands(),
    sma(),
    alma()
  ),
  options = list(
    dark = TRUE,
    deficiency = FALSE
  )
)

## charting the MACD-indicator
## with klines as subcharts
chart(
  ticker     = BTC,
  main       = macd(),
  sub        = list(
    volume(),
    kline()
  ),
  indicator = list(
    bollinger_bands(),
    sma()
  ),
  options = list(
    dark = TRUE,
    deficiency = FALSE
  )
)

# script end;

[Package cryptoQuotes version 1.3.0 Index]