Skip to contents

[Experimental]

A high-level plotly::add_lines()-wrapper function that interacts with the TTR::DonchianChannel()-function. The function adds Donchian Channels to the main chart().

Usage

donchian_channel(
 n = 10,
 include.lag = FALSE,
 color = '#4682b4',
 ...
)

Arguments

n

Number of periods for moving average.

include.lag

Should values be lagged so that today's prices are not included in the calculation? See Note.

color

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

...

For internal use. Please ignore.

Value

An invisible plotly::plot_ly()-object.

See also

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

Other main chart indicators: add_event(), alma(), bollinger_bands(), 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;