A high-level plotly::plot_ly()
- and plotly::add_lines()
-function that
interacts with the TTR::RSI()
-function.
The function adds a subchart with a TTR::RSI()
-indicator.
Usage
rsi(
price = "close",
n = 14,
maType = "SMA",
upper_limit = 80,
lower_limit = 20,
color = '#4682b4',
...
)
Arguments
- price
Price series that is coercible to xts or matrix.
- n
Number of periods for moving averages.
- maType
Either:
A function or a string naming the function to be called.
A list with the first component like (1) above, and additional parameters specified as named components. See Examples.
- upper_limit
A numeric-vector of length 1. 80 by default. Sets the upper limit of the TTR::RSI.
- lower_limit
A numeric-vector of length 1. 20 by default. Sets the lower limit of the TTR::RSI.
- color
- ...
For internal use. Please ignore.
Value
An invisible plotly::plot_ly()
-object.
See also
Examples
# script start;
# 1) charting weekly
# BTC using candlesticks
# and indicators
cryptoQuotes::chart(
ticker = BTC,
main = cryptoQuotes::kline(),
sub = list(
cryptoQuotes::volume(),
cryptoQuotes::macd()
),
indicator = list(
cryptoQuotes::bollinger_bands(),
cryptoQuotes::sma(),
cryptoQuotes::alma()
),
options = list(
dark = TRUE,
deficiency = FALSE
)
)
# script end;