EVOLUTION-MANAGER
Edit File: RSI.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: Relative Strength 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 RSI {TTR}"><tr><td>RSI {TTR}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Relative Strength Index</h2> <h3>Description</h3> <p>The Relative Strength Index (RSI) calculates a ratio of the recent upward price movements to the absolute price movement. Developed by J. Welles Wilder. </p> <h3>Usage</h3> <pre> RSI(price, n = 14, maType, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>price</code></td> <td> <p>Price series that is coercible to xts or matrix.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>Number of periods for moving averages.</p> </td></tr> <tr valign="top"><td><code>maType</code></td> <td> <p>Either: </p> <ol> <li><p> A function or a string naming the function to be called. </p> </li> <li><p> A <em>list</em> with the first component like (1) above, and additional parameters specified as <em>named</em> components. See Examples. </p> </li></ol> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Other arguments to be passed to the <code>maType</code> function in case (1) above.</p> </td></tr> </table> <h3>Details</h3> <p>The RSI calculation is <code>RSI = 100 - 100 / ( 1 + RS )</code>, where <code>RS</code> is the smoothed ratio of 'average' gains over 'average' losses. The 'averages' aren't true averages, since they're divided by the value of <code>n</code> and not the number of periods in which there are gains/losses. </p> <h3>Value</h3> <p>A object of the same class as <code>price</code> or a vector (if <code>try.xts</code> fails) containing the RSI values. </p> <h3>Note</h3> <p>The RSI is usually interpreted as an overbought/oversold (over 70 / below 30) indicator. Divergence with price may also be useful. For example, if price is making new highs/lows, but RSI is not, it could indicate a reversal. </p> <p>You can calculate a stochastic RSI by using the function <code><a href="stochastics.html">stoch</a></code> on RSI values. </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 /> Relative Strength Index:<br /> <a href="https://www.fmlabs.com/reference/RSI.htm">https://www.fmlabs.com/reference/RSI.htm</a><br /> <a href="https://www.metastock.com/Customer/Resources/TAAZ/?p=100">https://www.metastock.com/Customer/Resources/TAAZ/?p=100</a><br /> <a href="https://www.linnsoft.com/techind/relative-strength-index-rsi">https://www.linnsoft.com/techind/relative-strength-index-rsi</a><br /> <a href="https://school.stockcharts.com/doku.php?id=technical_indicators:relative_strength_index_rsi">https://school.stockcharts.com/doku.php?id=technical_indicators:relative_strength_index_rsi</a><br /> <br /> Stochastic RSI:<br /> <a href="https://www.fmlabs.com/reference/StochRSI.htm">https://www.fmlabs.com/reference/StochRSI.htm</a><br /> <a href="https://school.stockcharts.com/doku.php?id=technical_indicators:stochrsi">https://school.stockcharts.com/doku.php?id=technical_indicators:stochrsi</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="CMO.html">CMO</a></code> for a variation on RSI. </p> <h3>Examples</h3> <pre> data(ttrc) price <- ttrc[,"Close"] # Default case rsi <- RSI(price) # Case of one 'maType' for both MAs rsiMA1 <- RSI(price, n=14, maType="WMA", wts=ttrc[,"Volume"]) # Case of two different 'maType's for both MAs rsiMA2 <- RSI(price, n=14, maType=list(maUp=list(EMA),maDown=list(WMA))) </pre> <hr /><div style="text-align: center;">[Package <em>TTR</em> version 0.24.3 <a href="00Index.html">Index</a>]</div> </body></html>