EVOLUTION-MANAGER
Edit File: bollingerBands.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: Bollinger Bands</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 BBands {TTR}"><tr><td>BBands {TTR}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Bollinger Bands</h2> <h3>Description</h3> <p>Bollinger Bands are a way to compare a security's volatility and price levels over a period of time. Developed by John Bollinger. </p> <h3>Usage</h3> <pre> BBands(HLC, n = 20, maType, sd = 2, ...) </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>sd</code></td> <td> <p>The number of standard deviations to use.</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>Bollinger Bands consist of three lines: </p> <p>The middle band is generally a 20-period SMA of the typical price ([high + low + close]/3). The upper and lower bands are <code>sd</code> standard deviations (generally 2) above and below the MA. </p> <p>The middle band 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 matrix (if <code>try.xts</code> fails) containing the columns: </p> <dl> <dt> dn </dt><dd><p> The lower Bollinger Band. </p> </dd> <dt> mavg </dt><dd><p> The middle Moving Average (see notes). </p> </dd> <dt> up </dt><dd><p> The upper Bollinger Band. </p> </dd> <dt> pctB </dt><dd><p> The %B calculation. </p> </dd> </dl> <h3>Note</h3> <p>Using any moving average other than SMA will result in inconsistencies between the moving average calculation and the standard deviation calculation. Since, by definition, a rolling standard deviation uses a simple moving average. </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/Bollinger.htm">https://www.fmlabs.com/reference/Bollinger.htm</a><br /> <a href="https://www.fmlabs.com/reference/BollingerWidth.htm">https://www.fmlabs.com/reference/BollingerWidth.htm</a><br /> <a href="https://www.metastock.com/Customer/Resources/TAAZ/?p=36">https://www.metastock.com/Customer/Resources/TAAZ/?p=36</a><br /> <a href="https://www.linnsoft.com/techind/bollinger-bands">https://www.linnsoft.com/techind/bollinger-bands</a><br /> <a href="https://school.stockcharts.com/doku.php?id=technical_indicators:bollinger_bands">https://school.stockcharts.com/doku.php?id=technical_indicators:bollinger_bands</a><br /> <a href="https://school.stockcharts.com/doku.php?id=technical_indicators:bollinger_band_width">https://school.stockcharts.com/doku.php?id=technical_indicators:bollinger_band_width</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. </p> <h3>Examples</h3> <pre> ## The examples below show the differences between using a ## High-Low-Close series, and just a close series when ## calculating Bollinger Bands. data(ttrc) bbands.HLC <- BBands( ttrc[,c("High","Low","Close")] ) bbands.close <- BBands( ttrc[,"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>