This function is a high-level wrapper of the indicator functions and {plotly}-objects. Its implemented similar to the apply-family, where the indicator function is passed, and its additional arguments are specificied by ...
Internally it will look for a chart-object, and attach the indicator to the object if found. Otherwise it will return
the indicator as a plot if data is provided.
See also
Other Charting:
chart()
Examples
## charting in {talib}
## using {plotly}
x <- talib::BTC
## candlestick chart
## of BTC
talib::chart(x)
## adding indicators
## via indicator()
{
## simple moving
## averages
talib::indicator(
FUN = talib::SMA,
n = 7
)
talib::indicator(
FUN = talib::SMA,
n = 14
)
talib::indicator(
FUN = talib::SMA,
n = 21
)
## MACD
talib::indicator(
FUN = talib::MACD
)
## OBV
talib::indicator(
FUN = talib::OBV
)
}
#> Warning: Ignoring 33 observations
#> Warning: Ignoring 33 observations
## chart indicators
## without candlesticks
## by resetting the previous
## chart
talib::chart()
## chart indicator
talib::indicator(
FUN = stochastic,
data = x
)
