chartSeries(x,
type = c("auto", "candlesticks", "matchsticks", "bars","line"),
subset = NULL,
show.grid = TRUE,
name = NULL,
time.scale = NULL,
TA = c(addVo()),
line.type = "l",
bar.type = "ohlc",
xlab = "time", ylab = "price", theme = chartTheme("black"),
major.ticks='auto', minor.ticks=TRUE,
up.col,dn.col,color.vol = TRUE, multi.col = FALSE,
...)
Line charts are created with close data, or from single column time series.
TA
allows for the inclusion of a variety of
chart overlays and tecnical indicators. A full list is
available from addTA
. The default TA argument is
addVo()
- which adds volume, if available, to the
chart being drawn.
theme
requires an object of class chart.theme
, created
by a call to chartTheme
. This function can be used to modify the
look of the resulting chart. See chart.theme
for details.
line.type
and bar.type
allow further fine tuning of
chart styles to user tastes.
multi.col
implements a color coding scheme used in some
charting applications, and follows the following rules:
getSymbols
, addTA
, setTA
,
chartTheme
getSymbols("YHOO")
chartSeries(YHOO)
chartSeries(YHOO,theme=chartTheme('white'))
chartSeries(YHOO,TA=NULL) #no volume
chartSeries(YHOO,TA=c(addVo(),addBBands())) #add volume and Bollinger Bands from TTR
addMACD() # add MACD indicator to current chart
setTA()
chartSeries(YHOO) #draws chart again, this time will all indicators present
Run the code above in your browser using DataLab