Skip to contents

highchartstock() creates a Stock chart with the official Stock Tools GUI, advanced annotations and technical indicators. Use highchart(type = "stock") for a Stock chart without these additional interface assets.

Usage

highchartstock(
  hc_opts = list(),
  theme = getOption("highcharter.theme"),
  width = NULL,
  height = NULL,
  elementId = NULL
)

Arguments

hc_opts

A list object containing options defined as https://api.highcharts.com/highcharts/.

theme

A hc_theme class object-

width

A numeric width in pixels, or a CSS width such as "100%".

height

A numeric input in pixels.

elementId

Use an explicit element ID for the widget.

See also

Examples

data(sample_matrix, package = "xts")
prices <- xts::as.xts(sample_matrix)
highchartstock(width = "100%") |>
  hc_add_series(prices, name = "Price", id = "price") |>
  hc_add_series(type = "sma", linkedTo = "price", name = "5-day mean",
                params = list(period = 5)) |>
  hc_title(text = "Explore prices with Stock Tools")