A high-level plotly::plot_ly()
- and plotly::add_lines()
-function that
interacts with the TTR::SMI()
-function.
The function adds a subchart with a TTR::SMI()
-indicator.
Usage
smi(
nFastK = 14,
nFastD = 3,
nSlowD = 3,
maType,
bounded = TRUE,
smooth = 1,
upper_limit = 40,
lower_limit = -40,
color = "#4682b4",
...
)
Arguments
- nFastK
Number of periods for fast %K (i.e. the number of past periods to use).
- nFastD
Number of periods for fast %D (i.e. the number smoothing periods to apply to fast %K).
- nSlowD
Number of periods for slow %D (i.e. the number smoothing periods to apply to fast %D).
- 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.
- bounded
Logical, should current period's values be used in the calculation?
- smooth
Number of internal smoothing periods to be applied before calculating FastK. See Details.
- upper_limit
A numeric-vector of length 1. 40 by default. Sets the upper limit of the TTR::SMI.
- lower_limit
A numeric-vector of length 1. -40 by default. Sets the lower limit of the TTR::SMI.
- 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;