EVOLUTION-MANAGER
Edit File: CCI.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: Commodity Channel Index</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 CCI {TTR}"><tr><td>CCI {TTR}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Commodity Channel Index</h2> <h3>Description</h3> <p>The Commodity Channel Index (CCI) attempts to identify starting and ending trends. </p> <h3>Usage</h3> <pre> CCI(HLC, n = 20, maType, c = 0.015, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>HLC</code></td> <td> <p>Object that is coercible to xts or matrix and contains High-Low-Close prices. If only a univariate series is given, it will be used. See details.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>Number of periods for moving average.</p> </td></tr> <tr valign="top"><td><code>maType</code></td> <td> <p>A function or a string naming the function to be called.</p> </td></tr> <tr valign="top"><td><code>c</code></td> <td> <p>Constant to apply to the mean deviation.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Other arguments to be passed to the <code>maType</code> function.</p> </td></tr> </table> <h3>Details</h3> <p>CCI relates the current price and the average of price over <code>n</code> periods. The CCI usually falls in a channel of -100 to 100. A basic CCI trading system is: Buy (sell) if CCI rises above 100 (falls below -100) and sell (buy) when it falls below 100 (rises above -100). </p> <p>CCI is usually calculated using the typical price, but if a univariate series (e.g. Close, Weighted Close, Median Price, etc.) is provided, it will be used instead. </p> <h3>Value</h3> <p>A object of the same class as <code>HLC</code> or a vector (if <code>try.xts</code> fails) containing the CCI values. </p> <h3>Note</h3> <p>If <code>HLC</code> is a High-Low-Close matrix, then typical price will be calculated. If <code>HLC</code> is a vector, then those values will be used instead of the typical price. </p> <h3>Author(s)</h3> <p>Joshua Ulrich </p> <h3>References</h3> <p>The following site(s) were used to code/document this indicator:<br /> <a href="https://www.fmlabs.com/reference/CCI.htm">https://www.fmlabs.com/reference/CCI.htm</a><br /> <a href="https://www.metastock.com/Customer/Resources/TAAZ/?p=42">https://www.metastock.com/Customer/Resources/TAAZ/?p=42</a><br /> <a href="https://www.linnsoft.com/techind/cci-commodity-channel-index">https://www.linnsoft.com/techind/cci-commodity-channel-index</a><br /> <a href="https://school.stockcharts.com/doku.php?id=technical_indicators:commodity_channel_index_cci">https://school.stockcharts.com/doku.php?id=technical_indicators:commodity_channel_index_cci</a><br /> </p> <h3>See Also</h3> <p>See <code><a href="MovingAverages.html">EMA</a></code>, <code><a href="MovingAverages.html">SMA</a></code>, etc. for moving average options; and note Warning section. See <code><a href="aroon.html">aroon</a></code>, <code><a href="ADX.html">ADX</a></code>, <code><a href="TDI.html">TDI</a></code>, <code><a href="VHF.html">VHF</a></code>, <code><a href="GMMA.html">GMMA</a></code> for other indicators that measure trend direction/strength. </p> <h3>Examples</h3> <pre> data(ttrc) cci <- CCI(ttrc[,c("High","Low","Close")]) </pre> <hr /><div style="text-align: center;">[Package <em>TTR</em> version 0.24.3 <a href="00Index.html">Index</a>]</div> </body></html>