Skip to contents

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.

Usage

chart(x, type = "candlestick", idx = NULL, title, ...)

Arguments

x

An OHLC-V object coercible to data.frame.

type

A character of length 1. candlestick by default. Can be ohlc for OHLC bars.

idx

A vector with the same length of x. If passed it will replace the x-axis labels. See vignette("charting") for more details.

title

An optional character vector of length 1.

...

Parameters passed into plotly::plot_ly

Details

The function uses various controlable options:

talib.deficiency <logical>

FALSE by default. If TRUE it uses colorblind-friendly colors.

talib.chart.dark <logical>

TRUE by default. If FALSE it charting is done in light mode.

talib.chart.slider <logical>

FALSE by default. If TRUE a rangeslider is added to the chart.

talib.chart.slider.size <numeric>

0.05 by default. Controls the size of the rangeslider.

talib.chart.legend <logical>

TRUE by default. If FALSE the chart comes without legends.

talib.chart.scale <numeric>

1 by default. Controls the scale of fonts.

See also

Other Charting: indicator()

Author

Serkan Korkmaz

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()