Learn R Programming

cryptoQuotes (version 1.3.4)

alma: Add Arnaud Legoux Moving Average (ALMA) to the chart

Description

[Experimental]

A high-level plotly::add_lines()-wrapper function that interacts with {TTR}'s moving average family of functions. The function adds moving average indicators to the main chart().

Usage

alma(
 price  = "close",
 n      = 9,
 offset = 0.85,
 sigma  = 6,
 ...
)

Value

A plotly::plot_ly()-object

Arguments

price

A character-vector of length 1. "close" by default The name of the vector to passed into TTR::ALMA().

n

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

offset

Percentile at which the center of the distribution should occur.

sigma

Standard deviation of the distribution.

...

For internal use. Please ignore.

Author

Serkan Korkmaz

See Also

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

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

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

Examples

Run this code
# script start;

cryptoQuotes::chart(
  ticker = BTC,
  main = kline(),
  indicator = list(
    cryptoQuotes::ema(n = 7),
    cryptoQuotes::sma(n = 14),
    cryptoQuotes::wma(n = 21)
  )
)

# script end;

Run the code above in your browser using DataLab