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.grid = TRUE, 
                name = NULL,
                time.scale = NULL,
                TA = c(addVo()),
                line.type = "l",
                bar.type = "ohlc",
                xlab = "time", ylab = "price", theme = chartTheme("black"),
                up.col,dn.col,color.vol = TRUE, multi.col = FALSE,
                ...)

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

       x: an OHLC object - see details 

    type: style of chart to draw 

show.grid: display price grid lines? 

    name: name of chart 

time.scale: what is the timescale? automatically deduced 

      TA: a vector of technical indicators and params 

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: a chart.theme object 

  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.

     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:

   _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.

     The current implementation maintains a record of actions carried
     out for any particular chart.  This is used to recreate the
     original when adding new indicator.  A list of applied TA actions
     is available with a call to 'listTA'. This list can be assigned to
     a variable and used in new chart calls to recreate a set of
     technical indicators.  It is also possible to force all future
     charts to use the same indicators by calling 'setTA'.

     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', 'addTA', 'setTA', 'chartTheme'

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

     ## Not run: 
     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
     ## End(Not run)

