chartSeries             package:quantmod             R Documentation

_C_r_e_a_t_e _F_i_n_a_n_c_i_a_l _C_h_a_r_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Charting tool to create standard financial charts given a time
     series like object. Serves as the base function for future
     technical analysis additions. Possible chart styles include
     candles, matches (1 pixel candles), bars, and lines. Chart may
     have white or black background.

_U_s_a_g_e:

     chartSeries(x,
                type = c("auto", "candlesticks", "matchsticks", "bars","line"), 
                show.vol = TRUE, 
                show.grid = TRUE, 
                name = deparse(substitute(x)),
                time.scale = NULL,
                technicals = NULL,
                line.type = "l",
                bar.type = "ohlc",
                xlab = "time", ylab = "price", theme = "black",
                up.col,dn.col,color.vol = TRUE, multi.col = FALSE,
                ...)

     barChart(x,name=deparse(substitute(x)),type='bars',...)
     candleChart(x,name=deparse(substitute(x)),type='candlesticks',...)
     lineChart(x,name=deparse(substitute(x)),type='line',
               color.vol=FALSE,...)

_A_r_g_u_m_e_n_t_s:

       x: an OHLC object - see details 

    type: style of chart to draw 

show.vol: display volume on chart? 

show.grid: display price grid lines? 

    name: name of chart 

time.scale: what is the timescale? automatically deduced 

technicals: a list of technical indicators and params (yet to be added) 

line.type: type of line in line chart 

bar.type: type of barchart - ohlc or hlc 

    xlab: derived time scale 

    ylab: y axis label 

   theme: 'white' or 'black' background 

  up.col: up bar/candle color 

  dn.col: down bar/candle color 

color.vol: color code volume? 

multi.col: 4 color candle pattern 

     ...: additional parameters 

_D_e_t_a_i_l_s:

     Currently displays standard style OHLC charts familiar in
     financial applications, or line charts when not passes OHLC data.
     Works with objects having explicit time-series properties, at
     present limited to 'quantmod.OHLC' data as returned by
     'getSymbols.yahoo'. In theory any zoo object conforming to OHLC
     conventions can be coerced to a 'quantmod.OHLC' object, and thus
     charted.

     Line charts are created with close data, or from single column
     time series.

     Future versions will allow for additional charting functions to be
     called subsequently which will allow for additional information to
     be display on the chart, such as technical indicators/studies, as
     well as entry and exit points given a particular trade strategy.

     'line.type' and 'bar.type' allow further fine tuning of chart
     styles to user tastes, as do the addition of 'up.col' and 'dn.col'
     arguments.

     'multi.col' implements a color coding scheme used in some charting
     applications, and follows the following rules:

   _g_r_e_y => Op[t] < Cl[t] and Op[t] < Cl[t-1]

   _w_h_i_t_e => Op[t] < Cl[t] and Op[t] > Cl[t-1]

   _r_e_d => Op[t] > Cl[t] and Op[t] < Cl[t-1]

   _b_l_a_c_k => Op[t] > Cl[t] and Op[t] > Cl[t-1]

_V_a_l_u_e:

     Returns a standard chart plus volume, if available, suitably
     scaled.

_N_o_t_e:

     Most details can be fine-tuned within the function, though the
     code does a reasonable job of scaling and labelling axes for the
     user.

     This is mostly a proof-of-concept function. It is currently being
     rewritten with S4 style constructs to better facilitate the
     addition of technical analysis indicators, as well as more dynamic
     updating for adding additional series and rescaling.

     Additional motivation to add outlined candles to allow for scaling
     and advanced color coding is owed to Josh Ulrich, as are the base
     functions (from 'TTR') for the yet to be released technical
     analysis charting code

_A_u_t_h_o_r(_s):

     Jeffrey A. Ryan

_R_e_f_e_r_e_n_c_e_s:

     Josh Ulrich - 'TTR' package and multi.col coding

_S_e_e _A_l_s_o:

     'getSymbols'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     getSymbols("YHOO")
     chartSeries(YHOO)

     barChart(YHOO)
     candleChart(YHOO)
     matchChart(YHOO,theme="white")
     lineChart(YHOO)
     ## End(Not run)

