EVOLUTION-MANAGER
Edit File: chartSeries.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Create Financial Charts</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for chartSeries {quantmod}"><tr><td>chartSeries {quantmod}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Create Financial Charts </h2> <h3>Description</h3> <p>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. </p> <p><code>reChart</code> allows for dynamic changes to the chart without having to respecify the full chart parameters. </p> <h3>Usage</h3> <pre> chartSeries(x, type = c("auto", "candlesticks", "matchsticks", "bars","line"), subset = NULL, show.grid = TRUE, name = NULL, time.scale = NULL, log.scale = FALSE, TA = 'addVo()', TAsep=';', line.type = "l", bar.type = "ohlc", theme = chartTheme("black"), layout = NA, major.ticks='auto', minor.ticks=TRUE, yrange=NULL, plot=TRUE, up.col,dn.col,color.vol = TRUE, multi.col = FALSE, ...) reChart(type = c("auto", "candlesticks", "matchsticks", "bars","line"), subset = NULL, show.grid = TRUE, name = NULL, time.scale = NULL, line.type = "l", bar.type = "ohlc", theme = chartTheme("black"), major.ticks='auto', minor.ticks=TRUE, yrange=NULL, up.col,dn.col,color.vol = TRUE, multi.col = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p> an OHLC object - see details </p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p> style of chart to draw </p> </td></tr> <tr valign="top"><td><code>subset</code></td> <td> <p> xts style date subsetting argument </p> </td></tr> <tr valign="top"><td><code>show.grid</code></td> <td> <p> display price grid lines? </p> </td></tr> <tr valign="top"><td><code>name</code></td> <td> <p> name of chart </p> </td></tr> <tr valign="top"><td><code>time.scale</code></td> <td> <p> what is the timescale? automatically deduced (broken) </p> </td></tr> <tr valign="top"><td><code>log.scale</code></td> <td> <p> should the y-axis be log-scaled? </p> </td></tr> <tr valign="top"><td><code>TA</code></td> <td> <p> a vector of technical indicators and params, or character strings </p> </td></tr> <tr valign="top"><td><code>TAsep</code></td> <td> <p> TA delimiter for TA strings </p> </td></tr> <tr valign="top"><td><code>line.type</code></td> <td> <p> type of line in line chart </p> </td></tr> <tr valign="top"><td><code>bar.type</code></td> <td> <p> type of barchart - ohlc or hlc </p> </td></tr> <tr valign="top"><td><code>theme</code></td> <td> <p> a chart.theme object </p> </td></tr> <tr valign="top"><td><code>layout</code></td> <td> <p> if <code>NULL</code> bypass internal layout </p> </td></tr> <tr valign="top"><td><code>major.ticks</code></td> <td> <p> where should major ticks be drawn</p> </td></tr> <tr valign="top"><td><code>minor.ticks</code></td> <td> <p> should minor ticks be draw? </p> </td></tr> <tr valign="top"><td><code>yrange</code></td> <td> <p> override y-scale </p> </td></tr> <tr valign="top"><td><code>plot</code></td> <td> <p> should plot be drawn </p> </td></tr> <tr valign="top"><td><code>up.col</code></td> <td> <p> up bar/candle color </p> </td></tr> <tr valign="top"><td><code>dn.col</code></td> <td> <p> down bar/candle color </p> </td></tr> <tr valign="top"><td><code>color.vol</code></td> <td> <p> color code volume? </p> </td></tr> <tr valign="top"><td><code>multi.col</code></td> <td> <p> 4 color candle pattern </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p> additional parameters </p> </td></tr> </table> <h3>Details</h3> <p>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. </p> <p>Line charts are created with close data, or from single column time series. </p> <p>The <code>subset</code> argument can be used to specify a particular area of the series to view. The underlying series is left intact to allow for TA functions to use the full data set. Additionally, it is possible to use syntax borrowed from the <code>first</code> and <code>last</code> functions, e.g. ‘last 4 months’. </p> <p><code>TA</code> allows for the inclusion of a variety of chart overlays and tecnical indicators. A full list is available from <code>addTA</code>. The default TA argument is <code>addVo()</code> - which adds volume, if available, to the chart being drawn. </p> <p><code>theme</code> requires an object of class <code>chart.theme</code>, created by a call to <code>chartTheme</code>. This function can be used to modify the look of the resulting chart. See <code>chart.theme</code> for details. </p> <p><code>line.type</code> and <code>bar.type</code> allow further fine tuning of chart styles to user tastes. </p> <p><code>multi.col</code> implements a color coding scheme used in some charting applications, and follows the following rules: </p> <ul> <li><p>grey => Op[t] < Cl[t] and Op[t] < Cl[t-1] </p> </li> <li><p>white => Op[t] < Cl[t] and Op[t] > Cl[t-1] </p> </li> <li><p>red => Op[t] > Cl[t] and Op[t] < Cl[t-1] </p> </li> <li><p>black => Op[t] > Cl[t] and Op[t] > Cl[t-1] </p> </li></ul> <p><code>reChart</code> takes any number of arguments from the original chart call — and redraws the chart with the updated parameters. One item of note: if multiple color bars/candles are desired, it is necessary to respecify the <code>theme</code> argument. Additionally it is not possible to change TA parameters at present. This must be done with addTA/dropTA/swapTA/moveTA commands. </p> <h3>Value</h3> <p>Returns a standard chart plus volume, if available, suitably scaled. </p> <p>If <code>plot=FALSE</code> a chob object will be returned. </p> <h3>Note</h3> <p>Most details can be fine-tuned within the function, though the code does a reasonable job of scaling and labelling axes for the user. </p> <p>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 <code>listTA</code>. 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 <code>setTA</code>. </p> <p>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 <span class="pkg">TTR</span>) for the yet to be released technical analysis charting code. </p> <p>Many improvements in the current version were the result of conversations with Gabor Grothendieck. Many thanks to him. </p> <h3>Author(s)</h3> <p> Jeffrey A. Ryan </p> <h3>References</h3> <p> Josh Ulrich - <span class="pkg">TTR</span> package and multi.col coding </p> <h3>See Also</h3> <p><code><a href="getSymbols.html">getSymbols</a></code>, <code><a href="newTA.html">addTA</a></code>, <code><a href="setTA.html">setTA</a></code>, <code><a href="chartTheme.html">chartTheme</a></code> </p> <h3>Examples</h3> <pre> ## Not run: getSymbols("YHOO") chartSeries(YHOO) chartSeries(YHOO, subset='last 4 months') chartSeries(YHOO, subset='2007::2008-01') 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) </pre> <hr /><div style="text-align: center;">[Package <em>quantmod</em> version 0.4.20 <a href="00Index.html">Index</a>]</div> </body></html>