chart() is a generic S3 function for charting OHLC-V series interactively.
The function is a high-level plotly::plot_ly wrapper with pre-specified OHLC values based on the input data.
Call chart() without any arguments to reset the charting
environment. See vignette(topic = "charting", package = "talib") for more details.
Arguments
- x
An OHLC-V object coercible to data.frame.
- type
A character of length 1.
candlestickby default. Can beohlcfor OHLC bars.- idx
A vector with the same length of
x. If passed it will replace the x-axis labels. Seevignette("charting")for more details.- title
- ...
Parameters passed into plotly::plot_ly
Details
The function uses various controlable options:
- talib.deficiency <logical>
FALSEby default. IfTRUEit uses colorblind-friendly colors.- talib.chart.dark <logical>
TRUEby default. IfFALSEit charting is done in light mode.- talib.chart.slider <logical>
FALSEby default. IfTRUEarangeslideris added to the chart.- talib.chart.slider.size <numeric>
0.05 by default. Controls the size of the
rangeslider.- talib.chart.legend <logical>
TRUEby default. IfFALSEthe chart comes without legends.- talib.chart.scale <numeric>
1 by default. Controls the scale of fonts.
See also
Other Charting:
indicator()
Examples
## charting in {talib}
## using {plotly}
data(BTC, package = "talib")
## candlestick chart
## (default)
{
talib::chart(
BTC,
type = "candlestick"
)
}
## OHLC chart
{
talib::chart(
BTC,
type = "ohlc"
)
}
## reset the charting
## environment
talib::chart()
