hc_add_series_ohlc: Shorcut for create candlestick charts

Description Usage Arguments Examples

Description

This function helps to create candlestick from xts objects obtaining by getSymbols function from the quantmod.

Usage

1
hc_add_series_ohlc(hc, x, type = "candlestick", ...)

Arguments

hc

A highchart htmlwidget object.

x

A OHLC object from the quantmod package.

type

The type of chart. Can be candlestick or ohlc.

...

Aditional shared arguments for the data series (http://api.highcharts.com/highcharts#series).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  

## Not run: 

library("xts")

data(sample_matrix)

matrix_xts <- as.xts(sample_matrix, dateFormat = "Date")

head(matrix_xts)

class(matrix_xts)

highchart() %>% 
  hc_add_series_ohlc(matrix_xts)
   
library("quantmod")

x <- getSymbols("AAPL", auto.assign = FALSE)
y <- getSymbols("SPY", auto.assign = FALSE)

highchart() %>% 
  hc_add_series_ohlc(x) %>% 
  hc_add_series_ohlc(y)
  

## End(Not run)
  


Search within the highcharter package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.