EVOLUTION-MANAGER
Edit File: OHLC.Transformations.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: Extract and Transform OHLC Time-Series Columns</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 OHLC.Transformations {quantmod}"><tr><td>OHLC.Transformations {quantmod}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Extract and Transform OHLC Time-Series Columns </h2> <h3>Description</h3> <p>Extract (transformed) data from a suitable OHLC object. Column names must contain the complete description - either “Open”, “High”, “Low”, “Close”, “Volume”, or “Adjusted” - though may also contain additional characters. This is the default for objects returned from most <code>getSymbols</code> calls. </p> <p>In the case of functions consisting of combined Op, Hi, Lo, Cl (e.g. <code>ClCl(x)</code>) the one period transformation will be applied. </p> <p>For example, to return the Open to Close of a object it is possible to call <code>OpCl(x)</code>. If multiple periods are desired a call to the function <code>Delt</code> is necessary. </p> <p><code>seriesLo</code> and <code>seriesHi</code> will return the low and high, respectively, of a given series. </p> <p><code>seriesAccel</code>, <code>seriesDecel</code>, <code>seriesIncr</code>, and <code>seriesDecr</code>, return a vector of logicals indicating if the series is accellerating, decellerating, increasing, or decreasing. This is managed by <code>diff</code>, which provides NA fill and suitable re-indexing. These are here to make trade rules easier to read. </p> <p><code>HLC</code> extracts the High, Low, and Close columns. <code>OHLC</code> extracts the Open, High, Low, and Close columns. </p> <p>These functions are merely to speed the model specification process. All columns may also be extracted through standard R methods. </p> <p>Assignment will not work at present. </p> <p><code>getPrice</code> will attempt to extract price column(s) from a time series, using sensible defaults. Additionally, the user may provide by symbol and price preference. </p> <h3>Usage</h3> <pre> Op(x) Hi(x) Lo(x) Cl(x) Vo(x) Ad(x) seriesHi(x) seriesLo(x) seriesIncr(x, thresh=0, diff.=1L) seriesDecr(x, thresh=0, diff.=1L) OpCl(x) ClCl(x) HiCl(x) LoCl(x) LoHi(x) OpHi(x) OpLo(x) OpOp(x) HLC(x) OHLC(x) OHLCV(x) getPrice(x, symbol=NULL, prefer=NULL, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p> A data object with columns containing data to be extracted. </p> </td></tr> <tr valign="top"><td><code>thresh</code></td> <td> <p> noise threshold (seriesIncr/seriesDecr) </p> </td></tr> <tr valign="top"><td><code>diff.</code></td> <td> <p> differencing (seriesIncr/seriesDecr) </p> </td></tr> <tr valign="top"><td><code>symbol</code></td> <td> <p> text string containing the symbol to extract </p> </td></tr> <tr valign="top"><td><code>prefer</code></td> <td> <p> price type preference (see Details) </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p> not currently used </p> </td></tr> </table> <h3>Details</h3> <p>Internally, the code uses grep to locate the appropriate columns. Therefore it is necessary to use inputs with column names matching the requirements in the description section, though the exact naming convention is not as important. </p> <p><code>prefer</code> can be used with <code>getPrice</code> to extract many commonly used financial time series prices descriptions (e.g. open, high, low, close, bid, ask/offer, midpoint, trade, price). If the value of <code>prefer</code> does not match one of the currently supported types, it will be matched against the object column names using <code>grep</code>. </p> <h3>Value</h3> <p>Returns an object of the same class as the original series, with the appropriately column names if applicable and/or possible. The only exceptions are for <code>quantmod.OHLC</code> objects which will be returned as <code>zoo</code> objects, and calls to <code>seriesLo</code> and <code>seriesHi</code> which <em>may</em> return a numeric value instead of the original object type. </p> <h3>Author(s)</h3> <p> Jeffrey A. Ryan </p> <h3>See Also</h3> <p><code><a href="specifyModel.html">specifyModel</a></code> </p> <h3>Examples</h3> <pre> ## Not run: getSymbols('IBM',src='yahoo') Ad(IBM) Cl(IBM) ClCl(IBM) seriesHi(IBM) seriesHi(Lo(IBM)) removeSymbols('IBM') ## 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>