App-Chart

 view release on metacpan or  search on metacpan

lib/App/Chart/doc/chart.html  view on Meta::CPAN

</p>
<div class="example">
<pre class="example-preformatted">      p1 + p2 + ... + pN
SMA = ------------------
              N
</pre></div>

<p>Because old prices have the same weighting in the average as recent prices,
the SMA can be rising merely because old lower prices are dropping out of the
window.  The weighting of past days also makes it seem to lag behind recent
action.  The EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) and WMA (see <a class="pxref" href="#Weighted-Moving-Average">Weighted Moving Average</a>) approaches address that sort of lag.
</p>
<p>See also <a class="ref" href="#Momentum-and-Rate-of-Change">Momentum</a>, which show the slope of the SMA.
</p>

<hr>
</div>
<div class="section-level-extent" id="Exponential-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Weighted-Moving-Average" accesskey="n" rel="next">Weighted Moving Average</a>, Previous: <a href="#Simple-Moving-Average" accesskey="p" rel="prev">Simple Moving Average</a>, Up: <a href="#Averages" accesskey="u" rel="up">Averages</a> ...
</div>
<h3 class="section" id="Exponential-Moving-Average-1"><span>8.2 Exponential Moving Average<a class="copiable-link" href="#Exponential-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Exponential-moving-average"></a>
<a class="index-entry-id" id="index-EMA"></a>
<a class="index-entry-id" id="index-Average_002c-exponential"></a>
<a class="index-entry-id" id="index-Moving-average_002c-exponential"></a>

<p>An N-day exponential moving average (EMA) is a weighted average of today&rsquo;s
close and the preceding EMA value.  The weight for today&rsquo;s close is a
smoothing factor alpha, where <em class="math">alpha=2/(N+1)</em>.
</p>
<div class="example">
<pre class="example-preformatted">EMA[today] = alpha * close + (1-alpha) * EMA[yesterday]
</pre></div>

<p>The formula can also be written as follows, showing how the average moves
towards today&rsquo;s close by an alpha fraction of the distance from the old EMA
to the new close.
</p>
<div class="example">
<pre class="example-preformatted">EMA[today] = EMA[yesterday] + alpha * (close + EMA[yesterday])
</pre></div>

<p>Expanding out gives a power series with successively decreasing weight for
each day&rsquo;s price.  Writing <em class="math">f=1-alpha</em> and with p1 today&rsquo;s
closing price, p2 yesterday&rsquo;s, etc, then
</p>
<div class="example">
<pre class="example-preformatted">      p1 + p2*f + p3*(f^2) + p4*(f^3) + ...
EMA = -------------------------------------
       1 +   f  +    f^2   +    f^3   + ...
</pre></div>

<p>This is an infinite sum, but <em class="math">f</em> is less than 1 so each successive weight
<em class="math">f^k</em> is smaller and smaller, soon becoming negligible.  The most recent
<em class="math">N</em> days make up about 86.5% of the total.  The following graph shows how
the weights decrease for <em class="math">N=10</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-ema-weights.png" alt="EMA weights graph">
</div>
<p>Because recent prices have a higher weighting that past prices, the EMA
responds more quickly and tracks recent prices more closely than a simple
moving average (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>).
</p>
<a class="index-entry-id" id="index-EMA-period-by-Wilder"></a>
<a class="index-entry-id" id="index-Wilder-EMA-period"></a>
<a class="index-entry-id" id="index-Wilder_002c-J_002e-Welles"></a>
<a class="anchor" id="Wilder-EMA-period"></a><ul class="mini-toc">
<li><a href="#J_002e-Welles-Wilder" accesskey="1">J. Welles Wilder</a></li>
</ul>
<div class="subsection-level-extent" id="J_002e-Welles-Wilder">
<h4 class="subsection"><span>8.2.1 J. Welles Wilder<a class="copiable-link" href="#J_002e-Welles-Wilder"> &para;</a></span></h4>

<p>When working with N-day periods, it should be noted that J. Welles Wilder
uses a different reckoning of the decrease factor for EMAs.  For example for a
14-day EMA he writes
</p>
<div class="example">
<pre class="example-preformatted">              1           13
EMA[today] = -- * close + -- * EMA[yesterday]
             14           14
</pre></div>

<p>This is the same as the formula above, just a different <em class="math">f</em> factor.  When
Wilder gives &ldquo;W&rdquo; days, the equivalent &ldquo;N&rdquo; above is <em class="math">2*W-1</em>, so say
14 becomes 27.  This is also sometimes called a &ldquo;modified moving average&rdquo;.
</p>
<p>In the indicators designed by Wilder, Chart uses his reckoning, so that for
instance a 14-day RSI is entered at 14.  This applies to ATR, DMI (and ADX)
and RSI (see <a class="pxref" href="#Average-True-Range">Average True Range</a>, <a class="ref" href="#Directional-Movement-Index">Directional Movement Index</a>, and
<a class="ref" href="#Relative-Strength-Index">Relative Strength Index</a>).
</p>

<hr>
</div>
</div>
<div class="section-level-extent" id="Weighted-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Double-and-Triple-Exponential-Moving-Average" accesskey="n" rel="next">Double and Triple Exponential Moving Average</a>, Previous: <a href="#Exponential-Moving-Average" accesskey="p" rel="prev">Exponential Moving Average</a>, Up: <a h...
</div>
<h3 class="section" id="Weighted-Moving-Average-1"><span>8.3 Weighted Moving Average<a class="copiable-link" href="#Weighted-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Weighted-moving-average"></a>
<a class="index-entry-id" id="index-WMA"></a>
<a class="index-entry-id" id="index-Average_002c-weighted"></a>
<a class="index-entry-id" id="index-Moving-average_002c-weighted"></a>

<p>An N-day weighted moving average is an average of today&rsquo;s close and preceding
closes, with weighting factor N for today, <em class="math">N-1</em> for yesterday,
<em class="math">N-2</em> for the day before, etc.  The influence of past data thereby
decreases with its age, down to nothing beyond N days.
</p>
<p>The formula is as follows, with p1 for today&rsquo;s closing price, p2
yesterday&rsquo;s, etc.
</p>
<div class="example">
<pre class="example-preformatted">      N * p1 + (N-1) * p2 + (N-2) * p3 + ... + 2 * p[N-1] + pN
WMA = --------------------------------------------------------
        N    +    N-1     +     N-2    + ... +    2       + 1
</pre></div>

<p>Like the EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), the WMA gives a higher
weighting to recent prices than past prices, so it tracks those recent prices
more closely than a simple moving average (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>).
The following graph shows how the weights decrease for <em class="math">N=15</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-wma-weights.png" alt="WMA weights graph">
</div>

<hr>
</div>
<div class="section-level-extent" id="Double-and-Triple-Exponential-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Endpoint-Moving-Average" accesskey="n" rel="next">Endpoint Moving Average</a>, Previous: <a href="#Weighted-Moving-Average" accesskey="p" rel="prev">Weighted Moving Average</a>, Up: <a href="#Averages" accesskey="u" rel="up">Averages<...
</div>
<h3 class="section" id="Double-and-Triple-Exponential-Moving-Average-1"><span>8.4 Double and Triple Exponential Moving Average<a class="copiable-link" href="#Double-and-Triple-Exponential-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Double-exponential-moving-average"></a>
<a class="index-entry-id" id="index-Average_002c-double-exponential"></a>
<a class="index-entry-id" id="index-Moving-average_002c-double-exponential"></a>
<a class="index-entry-id" id="index-DEMA"></a>
<a class="index-entry-id" id="index-Triple-exponential-moving-average"></a>
<a class="index-entry-id" id="index-Average_002c-triple-exponential"></a>
<a class="index-entry-id" id="index-Moving-average_002c-triple-exponential"></a>
<a class="index-entry-id" id="index-TEMA"></a>

<p>The double exponential moving average (DEMA) and triple exponential moving
average (TEMA) are combination EMAs (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) by
Patrick Mulloy, designed to track recent prices even more closely than the
plain EMA.  The calculation for DEMA is
</p>
<div class="example">
<pre class="example-preformatted">DEMA = 2*EMA[N] - EMAofEMA[N]
</pre></div>

<p>and for TEMA,
</p>
<div class="example">
<pre class="example-preformatted">TEMA = 3*EMA[N] - 3*EMAofEMA[N] + EMAofEMAofEMA[N]
</pre></div>

<p>Both are &ldquo;overweight&rdquo; on recent points so the moving average can actually
get ahead of recent prices in some unusual price patterns.  The following
graph shows the DEMA weights for <em class="math">N=15</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-dema-weights.png" alt="DEMA weights graph">
</div>
<p>And the following is TEMA for the same <em class="math">N=15</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-tema-weights.png" alt="TEMA weights graph">
</div>

<hr>
</div>
<div class="section-level-extent" id="Endpoint-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Fractal-Adaptive-Moving-Average" accesskey="n" rel="next">Fractal Adaptive Moving Average</a>, Previous: <a href="#Double-and-Triple-Exponential-Moving-Average" accesskey="p" rel="prev">Double and Triple Exponential Moving Average</a>...
</div>
<h3 class="section" id="Endpoint-Moving-Average-1"><span>8.5 Endpoint Moving Average<a class="copiable-link" href="#Endpoint-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Endpoint-moving-average"></a>
<a class="index-entry-id" id="index-EPMA"></a>
<a class="index-entry-id" id="index-Least-squares-moving-average"></a>
<a class="index-entry-id" id="index-LSQMA"></a>
<a class="index-entry-id" id="index-Average_002c-endpoint"></a>
<a class="index-entry-id" id="index-Average_002c-least-squares"></a>
<a class="index-entry-id" id="index-Moving-average_002c-endpoint"></a>
<a class="index-entry-id" id="index-Moving-average_002c-least-squares"></a>
<a class="index-entry-id" id="index-Time-series-forecast"></a>
<a class="index-entry-id" id="index-TSF"></a>
<a class="index-entry-id" id="index-Sharp_002c-Joe"></a>
<a class="index-entry-id" id="index-Average_002c-modified"></a>
<a class="index-entry-id" id="index-Moving-average_002c-modified"></a>
<a class="index-entry-id" id="index-Modified-moving-average"></a>

<p>The endpoint moving average (EPMA) establishes an average price by fitting a
least squares straight line (see <a class="pxref" href="#Linear-Regression">Linear Regression</a>) through the past N
days closing prices and taking the endpoint of the line (ie. the line as at
the last day) as the average.
</p>
<p>This calculation goes by a number of other names, including least squares
moving average (LSQMA), moving linear regression, and time series forecast
(TSF).  Joe Sharp&rsquo;s &ldquo;modified moving average&rdquo; is the same thing too.
</p>
<p>The formula ends up being a straightforward weighted average of past N prices,
with weights going from <em class="math">2*N-1</em> down to <em class="math">-N+2</em>.  This is easily
derived from the least squares formulas, but just looking at the weightings
the connection to least squares is not at all obvious.  If p1 is today&rsquo;s
close, p2 yesterdays, etc, then
</p>
<div class="example">
<pre class="example-preformatted">       (2*N-1)*p[1] + (2*N-4)*p[2] + ... + (-N+2)*p[N]
EPMA = -----------------------------------------------
        2*N-1       +  2*N-4       + ... +  -N+2
</pre></div>

<p>The weights decrease by 3 for each older day, and go negative for the oldest
third of the N days.  The following graph shows that for <em class="math">N=15</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-epma-weights.png" alt="Endpoint MA weights graph">
</div>
<p>The negatives mean the average is &ldquo;overweight&rdquo; on recent prices and can
overshoot price action after a sudden jump.  In general however because the
fitted line deliberately goes through the middle of recent prices the EPMA
tends to be in the middle of recent prices, or a projection of where they
seemed to be trending.
</p>
<p>It&rsquo;s interesting to compare the EPMA with a plain SMA (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>).  An SMA effectively draws a horizontal line through the past N days
prices (their mean), whereas the EPMA draws a sloping line.
</p>
<p>The inertia indicator (see <a class="pxref" href="#Inertia">Inertia</a>) uses the EPMA.
</p>


<hr>
</div>
<div class="section-level-extent" id="Fractal-Adaptive-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Guppy-Multiple-Moving-Average" accesskey="n" rel="next">Guppy Multiple Moving Average</a>, Previous: <a href="#Endpoint-Moving-Average" accesskey="p" rel="prev">Endpoint Moving Average</a>, Up: <a href="#Averages" accesskey="u" rel="u...
</div>
<h3 class="section" id="Fractal-Adaptive-Moving-Average-1"><span>8.6 Fractal Adaptive Moving Average<a class="copiable-link" href="#Fractal-Adaptive-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Fractal-adaptive-moving-average"></a>
<a class="index-entry-id" id="index-FRAMA"></a>
<a class="index-entry-id" id="index-Average_002c-fractal-adaptive"></a>
<a class="index-entry-id" id="index-Moving-average_002c-fractal-adaptive"></a>

<p><a class="uref" href="http://www.mesasoftware.com/technicalpapers.htm">http://www.mesasoftware.com/technicalpapers.htm</a> <br>
<a class="uref" href="http://www.mesasoftware.com/Papers/FRAMA.pdf">http://www.mesasoftware.com/Papers/FRAMA.pdf</a>
</p>
<a class="index-entry-id" id="index-Ehlers_002c-John"></a>
<p>The fractal adaptive moving average (FRAMA) by John Ehlers is an exponential
style moving average (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) with an alpha
smoothing factor that varies according to a fractal dimension calculated over
the past N day&rsquo;s prices.
</p>
<p>The dimension is calculated by looking at the N days in two halves, the
immediately preceding N/2 days and the N/2 preceding that.  The trading ranges
in those halves are compared to the total range and an alpha factor for the
EMA generated.  The calculation is slightly tricky but in essence the amount
of overlap between the ranges is measured.  The alpha factor is small and the
EMA slow when the halves overlap.  The alpha is large and the EMA fast when
the halves don&rsquo;t overlap but add up to make the overall N day range.
</p>
<p>The FRAMA alpha factor and the fractal dimension value are available in the
lower indicator window, to see where they&rsquo;re big or small, under &ldquo;Low
Priority&rdquo; near the end of the indicators lists.
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources">
<h4 class="subsection"><span>8.6.1 Additional Resources<a class="copiable-link" href="#Additional-Resources"> &para;</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.traders.com/Documentation/FEEDbk_docs/Archive/102005/TradersTips/TradersTips.html">http://www.traders.com/Documentation/FEEDbk_docs/Archive/102005/TradersTips/TradersTips.html</a>
&ndash; TASC Oct 2005 Traders&rsquo; Tips various formulas [possibly gone].
</li></ul>


<hr>

lib/App/Chart/doc/chart.html  view on Meta::CPAN


<p><a class="uref" href="http://www.guppytraders.com/gup329.shtml">http://www.guppytraders.com/gup329.shtml</a> (summary at Darryl Guppy&rsquo;s web
site)
</p>
<a class="index-entry-id" id="index-Darryl-Guppy"></a>
<p>The Guppy multiple moving average (GMMA) by Darryl Guppy is a set of six short
term and six long term exponential moving averages (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), all drawn on the one chart.
</p>
<p>His standard periods are 3, 5, 8, 10, 12 and 15 days for the short averages,
and 30, 35, 40, 45, 50 and 60 days for the long averages.  These periods are
parameters in Chart to allow experimentation.  A value of 0 suppresses an
entry if less than twelve lines are desired.
</p>
<p>Guppy&rsquo;s approach is look for compression of the averages (the lines coming
together) in each group as signalling a likely trend change; and for steady
parallel or expanding lines as a continuing trend.  He emphasises that the
idea is not a moving average crossover system.
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources-1" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-1">
<h4 class="subsection"><span>8.7.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-1"> &para;</a></span></h4>

<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.incrediblecharts.com/technical/multiple_moving_averages.htm">http://www.incrediblecharts.com/technical/multiple_moving_averages.htm</a>
&ndash; sample graph of &lsquo;<samp class="samp">ASX.AX</samp>&rsquo; from 1999.
</li></ul>


<hr>
</div>
</div>
<div class="section-level-extent" id="Hull-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Kaufman-Adaptive-Moving-Average" accesskey="n" rel="next">Kaufman Adaptive Moving Average</a>, Previous: <a href="#Guppy-Multiple-Moving-Average" accesskey="p" rel="prev">Guppy Multiple Moving Average</a>, Up: <a href="#Averages" acce...
</div>
<h3 class="section" id="Hull-Moving-Average-1"><span>8.8 Hull Moving Average<a class="copiable-link" href="#Hull-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Hull-moving-average"></a>
<a class="index-entry-id" id="index-HMA"></a>

<p><a class="uref" href="http://www.alanhull.com/">http://www.alanhull.com/</a> <br>
<a class="uref" href="http://www.justdata.com.au/Journals/AlanHull/hull_ma.htm">http://www.justdata.com.au/Journals/AlanHull/hull_ma.htm</a>
</p>
<p>The Hull moving average (HMA) by Alan Hull is a combination of weighted moving
averages (see <a class="pxref" href="#Weighted-Moving-Average">Weighted Moving Average</a>) with a momentum component, designed
to have low lag.
</p>
<div class="example">
<pre class="example-preformatted">HMA = WMA[floor(sqrt(N))] of (2 * WMA[floor(N/2)] - WMA[N])
</pre></div>

<p>The average is weighted towards recent prices, and in fact has negative
weights for prices past about <em class="math">N/2</em> days ago.  Those negatives can make
the average overshoot actual price action after a big jump (the same as other
lag-reduced averages do).  The following graph shows the weights for
<em class="math">N=15</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-hull-weights.png" alt="Hull moving average weights graph">
</div>

<hr>
</div>
<div class="section-level-extent" id="Kaufman-Adaptive-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Laguerre-Filter" accesskey="n" rel="next">Laguerre Filter</a>, Previous: <a href="#Hull-Moving-Average" accesskey="p" rel="prev">Hull Moving Average</a>, Up: <a href="#Averages" accesskey="u" rel="up">Averages</a> &nbsp; [<a href="#Co...
</div>
<h3 class="section" id="Kaufman-Adaptive-Moving-Average-1"><span>8.9 Kaufman Adaptive Moving Average<a class="copiable-link" href="#Kaufman-Adaptive-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Kaufman-adaptive-moving-average"></a>
<a class="index-entry-id" id="index-KAMA"></a>
<a class="index-entry-id" id="index-Average_002c-Kaufman-adaptive"></a>
<a class="index-entry-id" id="index-Moving-average_002c-Kaufman-adaptive"></a>

<a class="index-entry-id" id="index-Kaufman_002c-Perry-J_002e"></a>
<p>The Kaufman adaptive moving average (KAMA) by Perry J. Kaufman
(<a class="uref" href="http://www.perrykaufman.com">http://www.perrykaufman.com</a>) is an exponential style average
(see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) but with a smoothing that varies
according to recent data.  In a steadily progressing move the latest prices
are tracked closely, but when going back and forward with little direction the
latest prices are given only small weights.
</p>
<p>The smoothing factor is determined from a given past N days closes (default
10).  The net change (up or down) over that time is expressed as a fraction of
the total daily changes (up and down).  This is called the &ldquo;efficiency
ratio&rdquo;.  If every day goes in the same direction then the two amounts are the
same and the ratio is 1.  But in the usual case where prices backtrack to some
extent then the net will be smaller than the total.  The ratio is 0 if no net
change at all.
</p>
<div class="example">
<pre class="example-preformatted">     abs (close[today] - close[N days ago])
ER = --------------------------------------
         Sum     abs (close - close[prev])
      past N days
</pre></div>

<p>The ER is rescaled to between 0.0645 and 0.666 and then squared to give an
alpha factor for the EMA of between 0.444 and 0.00416.  This corresponds to
EMA periods from a fast 3.5 days to a very slow 479.5 days.
</p>
<div class="example">
<pre class="example-preformatted">alpha = (ER * 0.6015 + 0.0645) ^ 2
</pre></div>

<p>An exponential moving average of prices is then taken, using each alpha value
calculated.
</p>
<div class="example">
<pre class="example-preformatted">KAMA = alpha * close + (1-alpha) * KAMA[prev]
</pre></div>

<p>These alpha values can be viewed directly with &ldquo;KAMA alpha&rdquo; in the lower
indicator window (a low priority option, near the end of the lists).  High
values show where KAMA is tracking recent prices closely, low values show
where it&rsquo;s responding only slowly.
</p>

<ul class="mini-toc">
<li><a href="#Additional-Resources-2" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-2">
<h4 class="subsection"><span>8.9.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-2"> &para;</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.traders.com/Documentation/FEEDbk_docs/Archive/0398/TradersTips/Tips9803.html">http://www.traders.com/Documentation/FEEDbk_docs/Archive/0398/TradersTips/Tips9803.html</a>
&ndash; TASC Trader&rsquo;s Tips March 1998 with various code.
</li><li><a class="uref" href="http://www.tssupport.com/support/base/?action=article&amp;id=1769">http://www.tssupport.com/support/base/?action=article&amp;id=1769</a> &ndash; short
tradestation article and EFS code.
</li></ul>


<hr>
</div>
</div>
<div class="section-level-extent" id="Laguerre-Filter">
<div class="nav-panel">
<p>
Next: <a href="#Median_002dAverage-Adaptive-Filter" accesskey="n" rel="next">Median-Average Adaptive Filter</a>, Previous: <a href="#Kaufman-Adaptive-Moving-Average" accesskey="p" rel="prev">Kaufman Adaptive Moving Average</a>, Up: <a href="#Averages...
</div>
<h3 class="section" id="Laguerre-Filter-1"><span>8.10 Laguerre Filter<a class="copiable-link" href="#Laguerre-Filter-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Laguerre-filter"></a>
<a class="index-entry-id" id="index-Filter_002c-Laguerre"></a>

<p><a class="uref" href="http://www.mesasoftware.com/technicalpapers.htm">http://www.mesasoftware.com/technicalpapers.htm</a> <br>
<a class="uref" href="http://www.mesasoftware.com/Papers/TIME%20WARP.pdf">http://www.mesasoftware.com/Papers/TIME%20WARP.pdf</a>
</p>
<a class="index-entry-id" id="index-Ehlers_002c-John-1"></a>
<p>The Laguerre Filter by John Elhers is a smoothing filter based on Laguerre
polynomials.  Its first term is an EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>),
followed by certain feedback terms.  The smoothing is controlled by an alpha
factor which is the alpha for the EMA and also damps the further terms.  Alpha
can range from 1 to follow prices almost exactly, down to 0 for a very slow
response.
</p>
<p>The result is still a weighted average of past prices.  The weights for
example for the default <em class="math">alpha=0.2</em> are as follows.
</p>
<br>
<div class="center"><img class="image" src="chart-laguerre-weights.png" alt="Laguerre Filter weights graph">
</div>
<a class="index-entry-id" id="index-Adaptive-laguerre-filter"></a>
<a class="anchor" id="Adaptive-Laguerre-Filter"></a></div>
<div class="section-level-extent" id="Adaptive-Laguerre-Filter-1">
<h3 class="section"><span>8.11 Adaptive Laguerre Filter<a class="copiable-link" href="#Adaptive-Laguerre-Filter-1"> &para;</a></span></h3>

<p>The adaptive laguerre filter is a variation on the laguerre filter using a
variable alpha factor which is based on how well the filter is tracking a
past N days prices.  The effect is to follow sustained moves quite closely,
but to change little when prices chop back and forwards in a range.
</p>
<p>The raw alpha values can be viewed as &ldquo;Adaptive Laguerre Alpha&rdquo; in the lower
indicator window, under &ldquo;Low Priority&rdquo; near the end of the indicator lists.
High values mean closely tracking prices, low values mean only slow response.
</p>

<hr>
</div>
<div class="section-level-extent" id="Median_002dAverage-Adaptive-Filter">
<div class="nav-panel">
<p>
Next: <a href="#Moving-Median" accesskey="n" rel="next">Moving Median</a>, Previous: <a href="#Laguerre-Filter" accesskey="p" rel="prev">Laguerre Filter</a>, Up: <a href="#Averages" accesskey="u" rel="up">Averages</a> &nbsp; [<a href="#Concept-Index"...
</div>
<h3 class="section" id="Median_002dAverage-Adaptive-Filter-1"><span>8.12 Median-Average Adaptive Filter<a class="copiable-link" href="#Median_002dAverage-Adaptive-Filter-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Median_002daverage-adaptive-filter"></a>
<a class="index-entry-id" id="index-Filter_002c-Median_002daverage"></a>

<p><a class="uref" href="http://www.mesasoftware.com/technicalpapers.htm">http://www.mesasoftware.com/technicalpapers.htm</a> <br>
<a class="uref" href="http://web.archive.org/web/20070720222047/http://www.mesasoftware.com/Papers/What%27s+the+Difference.exe">http://web.archive.org/web/20070720222047/http://www.mesasoftware.com/Papers/What%27s+the+Difference.exe</a>
(self-extracting zip file)
</p>
<a class="index-entry-id" id="index-Ehlers_002c-John-2"></a>
<p>The median-average adaptive filter by John Elhers is an EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) with an alpha smoothing factor that varies according to how
close it is to a median.
</p>
<p>The raw alpha values can be viewed as &ldquo;Median-Average Alpha&rdquo; in the lower
indicator window, under &ldquo;Low Priority&rdquo; in the indicator lists.  High values
are where the average is following recent prices closely.  The maximum is 0.5,
which corresponds to a 3-day EMA.
</p>

<hr>
</div>
<div class="section-level-extent" id="Moving-Median">
<div class="nav-panel">
<p>
Next: <a href="#Regularized-Exponential-Moving-Average" accesskey="n" rel="next">Regularized Exponential Moving Average</a>, Previous: <a href="#Median_002dAverage-Adaptive-Filter" accesskey="p" rel="prev">Median-Average Adaptive Filter</a>, Up: <a h...
</div>
<h3 class="section" id="Moving-Median-1"><span>8.13 Moving Median<a class="copiable-link" href="#Moving-Median-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Moving-median"></a>
<a class="index-entry-id" id="index-Median_002c-moving"></a>

<p>The moving median is simply the median of the past N days&rsquo; closing prices.
This may be of limited interest and is thus under &ldquo;Low Priority&rdquo; in the
indicator lists.
</p>
<p>For reference, a median is calculated by considering the prices sorted from
highest to lowest.  The middle one is the median, or if there&rsquo;s an even number
then the mean of the middle two.  So for example with 15 points the chosen
median point will have 7 others above it and 7 below it.  The effect when
plotted is a line that stays roughly in the middle of the past N days price
action.
</p>

<hr>
</div>
<div class="section-level-extent" id="Regularized-Exponential-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Sine-Weighted-Moving-Average" accesskey="n" rel="next">Sine Weighted Moving Average</a>, Previous: <a href="#Moving-Median" accesskey="p" rel="prev">Moving Median</a>, Up: <a href="#Averages" accesskey="u" rel="up">Averages</a> &nbsp;...
</div>
<h3 class="section" id="Regularized-Exponential-Moving-Average-1"><span>8.14 Regularized Exponential Moving Average<a class="copiable-link" href="#Regularized-Exponential-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Regularized-exponential-moving-average"></a>
<a class="index-entry-id" id="index-REMA"></a>
<a class="index-entry-id" id="index-Average_002c-regularized-exponential"></a>
<a class="index-entry-id" id="index-Moving-average_002c-regularized-exponential"></a>
<a class="index-entry-id" id="index-Exponential-moving-average_002c-regularized"></a>

<a class="index-entry-id" id="index-Satchwell_002c-Chris"></a>
<p>The regularized exponential moving average (REMA) by Chris Satchwell is a
variation on the EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) designed to be
smoother but not introduce too much extra lag.  The formula can be given in a
number of forms, such as
</p>
<div class="example">
<pre class="example-preformatted">       Rp + alpha*(close - Rp) + lambda*(Rp + (Rp-Rpp))
REMA = ---------------------------------------------
                 1             +      lambda
</pre></div>
<p>alpha = N-day smoothing per EMA <br>
Rp = yesterday&rsquo;s REMA <br>
Rpp = day before yesterday&rsquo;s REMA <br>
<em class="math">Lambda</em> is a factor controlling the amount of &ldquo;regularization&rdquo;.
</p>
<p>This form shows how there&rsquo;s an <em class="math">Rp+alpha*(close-Rp)</em> part like an EMA, and an <em class="math">Rp+(Rp-Rpp)</em> part
which projects from yesterday&rsquo;s REMA according to whether it was rising or
falling relative to the REMA of the day before.  The two parts are averaged
with a weighting 1 for the EMA part and <em class="math">lambda</em> for the projection.
</p>
<p>If <em class="math">lambda</em> is zero then REMA is the same as a plain EMA.
Satchwell suggests fairly small values for <em class="math">lambda</em>, and the default
in Chart is 0.5.  John Ehlers noted that if <em class="math">lambda</em> is large REMA
becomes unstable.
</p>
<p>In any case the result of the calculation is still an average of past prices
with a certain set of weights that progressively decrease for older data.  The
following is the weights for <em class="math">N=15</em> and <em class="math">lambda=0.5</em>,
</p>
<br>
<div class="center"><img class="image" src="chart-rema-weights.png" alt="Regularized EMA weights graph">
</div>
<ul class="mini-toc">
<li><a href="#REMA-Momentum-1" accesskey="1">REMA Momentum</a></li>
<li><a href="#Additional-Resources-3" accesskey="2">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="REMA-Momentum-1">
<h4 class="subsection"><span>8.14.1 REMA Momentum<a class="copiable-link" href="#REMA-Momentum-1"> &para;</a></span></h4>
<a class="anchor" id="REMA-Momentum"></a><a class="index-entry-id" id="index-REMA-Momentum"></a>
<a class="index-entry-id" id="index-Regularized-Momentum"></a>

<p>A momentum indicator is formed from REMA as the slope of the line from
yesterday&rsquo;s REMA to today&rsquo;s.
</p>
<div class="example">
<pre class="example-preformatted">         REMA - REMAprev
RegMom = ---------------
             REMAprev
</pre></div>

<p>This is like a Rate of Change (see <a class="pxref" href="#Momentum-and-Rate-of-Change">Momentum</a>), but on
just one day and as a fraction instead of a percentage.  A crossing through
zero of the RegMom is a peak or trough (and possibly just a flat spot before a
further rise or fall in the REMA line).
</p>
</div>
<div class="subsection-level-extent" id="Additional-Resources-3">
<h4 class="subsection"><span>8.14.2 Additional Resources<a class="copiable-link" href="#Additional-Resources-3"> &para;</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.traders.com/Documentation/FEEDbk_docs/Archive/072003/TradersTips/TradersTips.html">http://www.traders.com/Documentation/FEEDbk_docs/Archive/072003/TradersTips/TradersTips.html</a>
&ndash; TASC Traders&rsquo; Tips, August 2003, REMA and REMA momentum formulas.
</li></ul>


<hr>
</div>
</div>
<div class="section-level-extent" id="Sine-Weighted-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#T3-Moving-Average" accesskey="n" rel="next">T3 Moving Average</a>, Previous: <a href="#Regularized-Exponential-Moving-Average" accesskey="p" rel="prev">Regularized Exponential Moving Average</a>, Up: <a href="#Averages" accesskey="u" ...
</div>
<h3 class="section" id="Sine-Weighted-Moving-Average-1"><span>8.15 Sine Weighted Moving Average<a class="copiable-link" href="#Sine-Weighted-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Sine-weighted-moving-average"></a>
<a class="index-entry-id" id="index-Sine_002dMA"></a>
<a class="index-entry-id" id="index-Average_002c-sine-weighted"></a>
<a class="index-entry-id" id="index-Moving-average_002c-sine-weighted"></a>

<p>A sine weighted moving average (Sine-MA) applies weights to each day in the
shape of the bulge in a sine curve from 0 to <em class="math">pi</em>.  For an N-day average
the weightings are
</p>
<div class="example">
<pre class="example-preformatted">     /  1      \         /  2      \             /  N      \
sin |  --- * pi |,  sin |  --- * pi |, ..., sin |  --- * pi |
     \ N+1     /         \ N+1     /             \ N+1     /
</pre></div>

<p>The effect is that middle prices have the greatest weight (much like the TMA,
<a class="ref" href="#Triangular-Moving-Average">Triangular Moving Average</a>).  The graph below shows the weights for
<em class="math">N=10</em>.  In Chart SWMA is under &ldquo;Low Priority&rdquo; in the indicator lists.
</p>
<br>
<div class="center"><img class="image" src="chart-sine-weights.png" alt="Sine weights graph">
</div>

<hr>
</div>
<div class="section-level-extent" id="T3-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Triangular-Moving-Average" accesskey="n" rel="next">Triangular Moving Average</a>, Previous: <a href="#Sine-Weighted-Moving-Average" accesskey="p" rel="prev">Sine Weighted Moving Average</a>, Up: <a href="#Averages" accesskey="u" rel=...
</div>
<h3 class="section" id="T3-Moving-Average-1"><span>8.16 T3 Moving Average<a class="copiable-link" href="#T3-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-T3-moving-average"></a>

<p>The T3 moving average by Tim Tillson is a triple smoothed combination of the
DEMA (see <a class="pxref" href="#Double-and-Triple-Exponential-Moving-Average">Double and Triple Exponential Moving Average</a>) and a plain EMA
(see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>).
</p>
<p>A given &ldquo;volume factor&rdquo; V (default 0.7) controls how much of the DEMA is
used.  The factor ranges from 0 which gives a plain EMA, up to 1 which gives a
full DEMA.  Values in between are a combination.  The formula for this
&ldquo;generalized DEMA&rdquo; is
</p>
<div class="example">
<pre class="example-preformatted">GD(N,v) = (1-v)*EMA[N] + v*DEMA[N]
</pre></div>

<p>or equivalently as follows, emphasising how a portion of the momentum term
present in the DEMA is used,
</p>
<div class="example">
<pre class="example-preformatted">GD(N,v) = EMA[N] + v * (EMA[N] - EMAofEMA[N])
</pre></div>

<p>T3 applies this three times,
</p>
<div class="example">
<pre class="example-preformatted">T3(N,v) = GD(N,v) of GD(N,v) of GD(N,v)
</pre></div>

<p>The following graph shows the weightings that result from <em class="math">N=10</em> and
<em class="math">v=0.7</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-t3-weights.png" alt="T3 weights graph">
</div>
<p>At the lower <em class="math">v=0</em> extreme T3 is simply a tripled EMA (see <a class="pxref" href="#EMA-of-EMA-of-EMA">EMA of EMA of EMA</a>).  At the upper <em class="math">v=1</em> extreme T3 is a DEMA of DEMA of DEMA, and
the following is the weights for that (again <em class="math">N=10</em>),
</p>
<br>
<div class="center"><img class="image" src="chart-dema-3-weights.png" alt="DEMA of DEMA of DEMA weights graph">
</div>

<hr>
</div>
<div class="section-level-extent" id="Triangular-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Variable-Index-Dynamic-Average" accesskey="n" rel="next">Variable Index Dynamic Average</a>, Previous: <a href="#T3-Moving-Average" accesskey="p" rel="prev">T3 Moving Average</a>, Up: <a href="#Averages" accesskey="u" rel="up">Average...
</div>
<h3 class="section" id="Triangular-Moving-Average-1"><span>8.17 Triangular Moving Average<a class="copiable-link" href="#Triangular-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Triangular-moving-average"></a>
<a class="index-entry-id" id="index-TMA"></a>
<a class="index-entry-id" id="index-Average_002c-triangular"></a>
<a class="index-entry-id" id="index-Moving-average_002c-triangular"></a>

<p>A triangular moving average (TMA) applies weights to each day in a triangular
shape.  For example on a 7-day average the weights are 1, 2, 3, 4, 3, 2, 1, or
the following graph shows a 15-day average.  The middle prices in the period
have the greatest weight, and the oldest or newest only a small weight.
</p>
<br>
<div class="center"><img class="image" src="chart-tma-weights.png" alt="Triangular weights graph">
</div>
<p>It&rsquo;s interesting to note TMA is equivalent to a twice-smoothed simple moving
average of half period (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>).
</p>
<div class="example">
<pre class="example-preformatted">TMA[N] = SMA[floor(N/2)+1] of SMA[ceil(N/2)]
</pre></div>

<p>In Chart TMA is under &ldquo;Low Priority&rdquo; in the indicator lists.
</p>

<hr>
</div>
<div class="section-level-extent" id="Variable-Index-Dynamic-Average">
<div class="nav-panel">
<p>
Next: <a href="#Volume-Weighted-Moving-Average" accesskey="n" rel="next">Volume Weighted Moving Average</a>, Previous: <a href="#Triangular-Moving-Average" accesskey="p" rel="prev">Triangular Moving Average</a>, Up: <a href="#Averages" accesskey="u" ...
</div>
<h3 class="section" id="Variable-Index-Dynamic-Average-1"><span>8.18 Variable Index Dynamic Average<a class="copiable-link" href="#Variable-Index-Dynamic-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Variable-index-dynamic-average"></a>
<a class="index-entry-id" id="index-VIDYA"></a>
<a class="index-entry-id" id="index-Average_002c-variable-index-dynamic"></a>
<a class="index-entry-id" id="index-Moving-average_002c-variable-index-dynamic"></a>

<a class="index-entry-id" id="index-Chande_002c-Tushar"></a>
<a class="index-entry-id" id="index-Kroll_002c-Stanley"></a>
<p>The variable index dynamic average (VIDYA) by Tushar Chande and Stanley Kroll
(in their book <i class="i">The New Technical Trader</i>, 1984) is an exponential style
moving average (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) with a smoothing that
varies according to recent price volatility.
</p>
<p>A volatility measure is obtained by taking the standard deviation (stddev,
see <a class="pxref" href="#Standard-Deviation">Standard Deviation</a>) of the past 9 days closing prices, expressed as a
fraction of a longer stddev of 30 days.  A scaling factor of 0.2 produces an
alpha usually in the range of about 0.3 to 0.1, corresponding to EMA periods
of about 5 to 20 days.
</p>
<div class="example">
<pre class="example-preformatted">              stddev[short] of closing prices
alpha = 0.2 * -------------------------------
              stddev[long] of closing prices
</pre></div>

<p>An exponential moving average of prices is then formed in the usual way, with
each day&rsquo;s alpha.
</p>
<div class="example">
<pre class="example-preformatted">VIDYA = alpha * close + (1-alpha) * VIDYA[prev]
</pre></div>

<p>The alpha values can be viewed directly with &ldquo;VIDYA alpha&rdquo; in the lower
indicator window, under &ldquo;Low Priority&rdquo; in the indicator lists.  High values
show where the VIDYA is tracking recent prices closely, low values show where
it&rsquo;s responding only slowly.
</p>

<hr>
</div>
<div class="section-level-extent" id="Volume-Weighted-Moving-Average">
<div class="nav-panel">

lib/App/Chart/doc/chart.html  view on Meta::CPAN

<a class="index-entry-id" id="index-Moving-average_002c-volume-weighted"></a>

<p>An N-day volume weighted moving average (VWMA) is the average of the past N
days closing prices, each weighted in proportion to the volume on that day.
So if p1 is today&rsquo;s closing price, p2 yesterday&rsquo;s, etc, and
v1, v2, etc similarly the volumes, then the VWMA for today is
</p>
<div class="example">
<pre class="example-preformatted">       v1 * p1 + v2 * p2 + ... + vN * pN
VWMA = ---------------------------------
          v1   +    v2   + ... +    vN
</pre></div>

<p>The effect is to give greater significance to days with greater volume, making
the average tend towards those days&rsquo; closing prices more.  If all volumes are
about the same then the VWMA becomes a simple moving average (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>).
</p>
<p>A true VWMA, the kind frequently specified for dividend reinvestment plans and
other things needing an average price around a particular period, takes every
price level and the volume transacted at that level.  Chart doesn&rsquo;t have the
data needed for that and the calculation above instead effectively attributes
all volume to the closing price.
</p>

<hr>
</div>
<div class="section-level-extent" id="Zero_002dLag-Exponential-Moving-Average">
<div class="nav-panel">
<p>
Previous: <a href="#Volume-Weighted-Moving-Average" accesskey="p" rel="prev">Volume Weighted Moving Average</a>, Up: <a href="#Averages" accesskey="u" rel="up">Averages</a> &nbsp; [<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<h3 class="section" id="Zero_002dLag-Exponential-Moving-Average-1"><span>8.20 Zero-Lag Exponential Moving Average<a class="copiable-link" href="#Zero_002dLag-Exponential-Moving-Average-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-zero_002dlag-exponential-moving-average"></a>
<a class="index-entry-id" id="index-Average_002c-zero_002dlag-exponential"></a>
<a class="index-entry-id" id="index-Moving-average_002c-zero_002dlag-exponential"></a>
<a class="index-entry-id" id="index-ZLEMA"></a>

<p>The zero-lag exponential moving average (ZLEMA) is a variation of the EMA
(see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) which adds a momentum term aiming to
reduce lag in the average so as to track current prices more closely.  For a
given N-day period the formula is
</p>
<div class="example">
<pre class="example-preformatted">ZLEMA = EMA of (close + (close-close[lag]))
</pre></div>

<p>Where the &ldquo;lag&rdquo; period is <em class="math">(N-1)/2</em>.  A plain EMA applied to straight
line points ends up always being the close at <em class="math">(N-1)/2</em> days ago.  So the
idea of adding in this difference &ldquo;close - close[lag]&rdquo; is to compensate for
that lag, to make the ZLEMA track a straight line exactly.  Of course real
data is rarely a straight line, but the principle is to push the ZLEMA towards
approximately the current close.
</p>
<p>The calculation still ends up as various weights on each past price.  The
effect of the momentum term is to make recent prices &ldquo;over weight&rdquo; and thus
tracked closely, and with negative weights on past terms.  There&rsquo;s a sudden
jump in the weights at the momentum lag point.  For example the following
graph is the weights for <em class="math">N=15</em> (lag point 7).
</p>
<br>
<div class="center"><img class="image" src="chart-zlema-weights.png" alt="Zero-lag EMA weights graph">
</div>
<p>The EMA lag on a straight line can be calculated easily using the power
formula for the EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), applied to an
infinite sequence of prices going downwards by 1 each day and reaching 0 at
today.  On non straight line sequences the lag is not a simple <em class="math">(N-1)/2</em>,
but will vary according to shape, period of cyclical components, etc.
</p>

<hr>
</div>
</div>
<div class="chapter-level-extent" id="Channels-and-Boxes">
<div class="nav-panel">
<p>
Next: <a href="#Indicators" accesskey="n" rel="next">Indicators</a>, Previous: <a href="#Averages" accesskey="p" rel="prev">Averages</a>, Up: <a href="#Top" accesskey="u" rel="up">Chart</a> &nbsp; [<a href="#Concept-Index" title="Index" rel="index">I...
</div>
<h2 class="chapter" id="Channels-and-Boxes-1"><span>9 Channels and Boxes<a class="copiable-link" href="#Channels-and-Boxes-1"> &para;</a></span></h2>
<a class="index-entry-id" id="index-Channels"></a>
<a class="index-entry-id" id="index-Boxes"></a>



<ul class="mini-toc">
<li><a href="#Bollinger-Bands" accesskey="1">Bollinger Bands</a></li>
<li><a href="#Darvas-Boxes" accesskey="2">Darvas Boxes</a></li>
<li><a href="#Donchian-Channel" accesskey="3">Donchian Channel</a></li>
<li><a href="#Ichimoku-Kinko-Hyo" accesskey="4">Ichimoku Kinko Hyo</a></li>
<li><a href="#Keltner-Channel" accesskey="5">Keltner Channel</a></li>
<li><a href="#Kirshenbaum-Bands" accesskey="6">Kirshenbaum Bands</a></li>
<li><a href="#Parabolic-SAR" accesskey="7">Parabolic SAR</a></li>
</ul>
<hr>
<div class="section-level-extent" id="Bollinger-Bands">
<div class="nav-panel">
<p>
Next: <a href="#Darvas-Boxes" accesskey="n" rel="next">Darvas Boxes</a>, Previous: <a href="#Channels-and-Boxes" accesskey="p" rel="prev">Channels and Boxes</a>, Up: <a href="#Channels-and-Boxes" accesskey="u" rel="up">Channels and Boxes</a> &nbsp; [...
</div>
<h3 class="section" id="Bollinger-Bands-1"><span>9.1 Bollinger Bands<a class="copiable-link" href="#Bollinger-Bands-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Bollinger-bands"></a>
<a class="index-entry-id" id="index-Average-1"></a>
<a class="index-entry-id" id="index-Moving-average"></a>
<a class="index-entry-id" id="index-Variance"></a>
<a class="index-entry-id" id="index-Deviation"></a>
<a class="index-entry-id" id="index-Standard-deviation"></a>

<p><a class="uref" href="http://www.bollingerbands.com">http://www.bollingerbands.com</a>
</p>
<a class="index-entry-id" id="index-Bollinger_002c-John"></a>
<p>Bollinger bands by John Bollinger are an N-day simple moving average
(see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>) with an upper and lower bands drawn at 1
standard deviation away from the average.  The distance multiple is
configurable.
</p>
<p>Standard deviation (see <a class="pxref" href="#Standard-Deviation">Standard Deviation</a>) is a statistical measure of
how much the values in a data set (the N closing prices in this case) deviate
from their average (the mean).  When prices are not changing much the
deviation is small and the band lines are close to the average.  The bands are
further away when closing prices are more volatile.
</p>
<p>See also <a class="ref" href="#Kirshenbaum-Bands">Kirshenbaum Bands</a>, which are similar but with a channel width

lib/App/Chart/doc/chart.html  view on Meta::CPAN

<p>A crossing of the MACD up through the signal line is taken as a buy signal, or
downwards a sell signal.  The difference between these lines is shown as a
histogram (solid white block).  This helps show whether the lines are coming
together or going further apart.
</p>
<div class="example">
<pre class="example-preformatted">histogram = MACD - signal
</pre></div>

<p>Crossings of the MACD line up or down through zero are also interpreted as
bullish or bearish (respectively).  This corresponds to crossings of the
underlying EMA[12] up or down through the EMA[26].
</p>
<p>Periods 12,26,9 are frequently used, but can be varied in Chart (see <a class="pxref" href="#View-Style">View Style</a>).
</p>

<hr>
</div>
<div class="section-level-extent" id="MASS-Index">
<div class="nav-panel">
<p>
Next: <a href="#Momentum-and-Rate-of-Change" accesskey="n" rel="next">Momentum</a>, Previous: <a href="#MACD" accesskey="p" rel="prev">MACD</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbsp; [<a href="#Concept-Index" title="I...
</div>
<h3 class="section" id="MASS-Index-1"><span>10.22 MASS Index<a class="copiable-link" href="#MASS-Index-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-MASS-index"></a>
<a class="index-entry-id" id="index-Index_002c-MASS"></a>

<a class="index-entry-id" id="index-Dorsey_002c-Donald"></a>
<p>The MASS index by Donald Dorsey is based on daily trading range.  Each day&rsquo;s
range high to low is calculated and those values are smoothed with a 9-day EMA
(see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>).  A ratio of that value with a second EMA
smoothing is then taken, and the past 25 days of those ratios added up.
</p>
<div class="example">
<pre class="example-preformatted">                    EMA[9] of high-low
MASS = Sum[25] of -----------------------
                  EMAofEMA[9] of high-low
</pre></div>

<p>The EMA and the EMA of EMA are normally quite close, making their ratio
usually about 1 and hence the sum formed is usually close to 25.  The most
significant pattern Dorsey looked for was a &ldquo;reversal bulge&rdquo; where the index
goes above 27 then falls back below 26.5, indicating a widening of daily
trading range and suggesting a reversal in price is likely.
</p>
<a class="index-entry-id" id="index-EMA-of-EMA"></a>
<a class="index-entry-id" id="index-Double-exponential-moving-average-1"></a>
<a class="index-entry-id" id="index-Average_002c-double-exponential-1"></a>
<a class="index-entry-id" id="index-Moving-average_002c-double-exponential-1"></a>
<a class="anchor" id="EMA-of-EMA"></a></div>
<div class="section-level-extent" id="EMA-of-EMA-1">
<h3 class="section"><span>10.23 EMA of EMA<a class="copiable-link" href="#EMA-of-EMA-1"> &para;</a></span></h3>

<p>Applying an EMA a second time gives a quite different result from a plain
EMA.  It&rsquo;s still a weighted average of recent prices, but whereas a plain EMA
is dominated by the most recent prices, a double EMA spreads more broadly, and
the latest few days&rsquo; influence is in fact smaller than the peak weights (at
about N/2 days back).  The following graph shows the weights for <em class="math">N=10</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-ema-2-weights.png" alt="EMA of EMA weights graph">
</div>
<p>The twice-smoothed EMA is also available directly as a moving average option,
under &ldquo;Low Priority&rdquo; in the indicator lists, to see its effect on prices or
on an oscillator.
</p>

<hr>
</div>
<div class="section-level-extent" id="Momentum-and-Rate-of-Change">
<div class="nav-panel">
<p>
Next: <a href="#Money-Flow-Index" accesskey="n" rel="next">Money Flow Index</a>, Previous: <a href="#MASS-Index" accesskey="p" rel="prev">MASS Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbsp; [<a href="#Concept-Index"...
</div>
<h3 class="section" id="Momentum"><span>10.24 Momentum<a class="copiable-link" href="#Momentum"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Momentum"></a>
<a class="index-entry-id" id="index-Rate-of-change"></a>
<a class="index-entry-id" id="index-ROC"></a>

<p>Momentum and rate of change show a difference between today&rsquo;s close and the
close N days ago.  Momentum is the difference as a price amount (positive or
negative), rate of change scales it to a percentage increase or decrease from
that N-day ago close.  This scaling is an advantage if comparing past times
when prices levels were much higher or lower than now.  If p1 is today,
p2 yesterday, etc, then
</p>
<div class="example">
<pre class="example-preformatted">Momentum = p[1] - p[N+1]

            p[1] - p[N+1]
ROC = 100 * -------------
               p[N+1]
</pre></div>

<p>It will be noticed that momentum is the difference between an N-day simple
moving average (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>) for today and yesterday, with a
scale factor N, ie.
</p>
<div class="example">
<pre class="example-preformatted">Momentum
-------- = SMA[today] - SMA[yesterday]
   N
</pre></div>

<p>This is the slope of the SMA line (price change per day) at that point.
Momentum crosses up through zero when SMA makes a peak, or down through zero
when SMA makes a trough.  The TRIX indicator (see <a class="pxref" href="#TRIX">TRIX</a>) does a similar
thing with a triple exponential moving average.
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources-7" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-7">
<h4 class="subsection"><span>10.24.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-7"> &para;</a></span></h4>

<ul class="itemize mark-bullet">
<li><a class="uref" href="http://trader.online.pl/MSZ/e-w-Chandes_Trendscore.html">http://trader.online.pl/MSZ/e-w-Chandes_Trendscore.html</a> &ndash; Formula and
sample on Polish WIG20 from 2000.
</li></ul>


lib/App/Chart/doc/chart.html  view on Meta::CPAN

</p>
<p>The two EMA periods are parameters in Chart.  If you set one of them to 1 then
you get a plain RSI, though with a period by the usual reckoning whereas the
RSI is in Wilder&rsquo;s style (see <a class="pxref" href="#Wilder-EMA-period">Wilder EMA period</a>), so for instance a TSI
27,1 is equivalent to an RSI 14.
</p>
<p>See <a class="ref" href="#EMA-of-EMA">EMA of EMA</a> for the effect of two EMAs.  In general it leads to less
weighting on the most recent data (the close-to-close differences in this
case) than a single EMA.
</p>
<p>See also CMO (see <a class="pxref" href="#Chande-Momentum-Oscillator">Chande Momentum Oscillator</a>) using another different
moving average for an RSI.
</p>

<hr>
</div>
<div class="section-level-extent" id="TRIX">
<div class="nav-panel">
<p>
Next: <a href="#Twiggs-Money-Flow" accesskey="n" rel="next">Twiggs Money Flow</a>, Previous: <a href="#True-Strength-Index" accesskey="p" rel="prev">True Strength Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbsp; [<a h...
</div>
<h3 class="section" id="TRIX-1"><span>10.43 TRIX<a class="copiable-link" href="#TRIX-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-TRIX"></a>

<a class="index-entry-id" id="index-Hutson_002c-Jack"></a>
<p>TRIX by Jack Hutson shows the slope of a triple-smoothed N-day exponential
moving average of closing prices.  The slope is calculated as a percentage
change between today and yesterday&rsquo;s triple smoothed EMA values.
</p>
<div class="example">
<pre class="example-preformatted">             EMAofEMAofEMA[today] - EMAofEMAofEMA[yesterday]
TRIX = 100 * ---------------------------------------
                    EMAofEMAofEMA[yesterday]
</pre></div>

<p>A positive TRIX means the triple EMA is rising, suggesting a steady uptrend,
in the same way any rising moving average does.  Conversely a negative value
means the triple EMA is falling, suggesting a downtrend.  A cross through zero
is a peak or trough in the triple EMA and may suggest a trend change.  Chart
draws a line at the zero level.
</p>
<a class="index-entry-id" id="index-EMA-of-EMA-of-EMA"></a>
<a class="index-entry-id" id="index-Triple-exponential-moving-average-1"></a>
<a class="index-entry-id" id="index-Average_002c-triple-exponential-1"></a>
<a class="index-entry-id" id="index-Moving-average_002c-triple-exponential-1"></a>
<a class="anchor" id="EMA-of-EMA-of-EMA"></a></div>
<div class="section-level-extent" id="EMA-of-EMA-of-EMA-1">
<h3 class="section"><span>10.44 EMA of EMA of EMA<a class="copiable-link" href="#EMA-of-EMA-of-EMA-1"> &para;</a></span></h3>

<p>A triple smoothed EMA is prices smoothed with an EMA then those values
smoothed again with another EMA and finally a third time with a further EMA
(all of the same given period).
</p>
<p>The result is quite different from a plain EMA.  It&rsquo;s still a weighted
average of recent prices, but whereas a plain EMA is dominated by the most
recent prices, a triple EMA spreads much more broadly, and the latest few
days&rsquo; influence is in fact smaller than the peak weights (at about N-days
back).  The following graph shows the weights for <em class="math">N=10</em>.
</p>
<br>
<div class="center"><img class="image" src="chart-ema-3-weights.png" alt="EMA of EMA of EMA weights graph">
</div>
<p>An EMA of EMA of EMA can also be viewed directly, in the upper prices window.
This can be used to see the effect its smoothing has, and may help for
adjusting the period N to get a desired smoothness versus responsiveness.
Note the N-day period is set separately for the two windows.
</p>

<hr>
</div>
<div class="section-level-extent" id="Twiggs-Money-Flow">
<div class="nav-panel">
<p>
Next: <a href="#Ulcer-Index" accesskey="n" rel="next">Ulcer Index</a>, Previous: <a href="#TRIX" accesskey="p" rel="prev">TRIX</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbsp; [<a href="#Concept-Index" title="Index" rel="in...
</div>
<h3 class="section" id="Twiggs-Money-Flow-1"><span>10.45 Twiggs Money Flow<a class="copiable-link" href="#Twiggs-Money-Flow-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Twiggs-money-flow"></a>
<a class="index-entry-id" id="index-Money-flow_002c-Twiggs"></a>
<a class="index-entry-id" id="index-Index_002c-Twiggs-money-flow"></a>

<p><a class="uref" href="http://www.incrediblecharts.com/technical/twiggs_money_flow.htm">http://www.incrediblecharts.com/technical/twiggs_money_flow.htm</a>
</p>
<a class="index-entry-id" id="index-Twiggs_002c-Colin"></a>
<p>The Twiggs money flow index by Colin Twiggs is a variation of the Chaikin
money flow index (see <a class="pxref" href="#Chaikin-Money-Flow">Chaikin Money Flow</a>) using true range so as to
include gap moves, and using EMA smoothing (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) to avoid jumps when a high volume day drops out of the calculation.
The formula is
</p>
<div class="example">
<pre class="example-preformatted">                                /      close - truelow       \
            EMA[N] of  volume * | 2 * ------------------ - 1 |
                                \     truehigh - truelow     /
Twiggs MF = --------------------------------------------------
                  EMA[N] of  volume

truehigh = max (high, prevclose)
truelow  = min (low,  prevclose)
</pre></div>

<p>The default EMA period is 21 days, and the period is reckoned by J. Welles
Wilder&rsquo;s method (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>).
</p>

<hr>
</div>
<div class="section-level-extent" id="Ulcer-Index">
<div class="nav-panel">
<p>
Next: <a href="#Ultimate-Oscillator" accesskey="n" rel="next">Ultimate Oscillator</a>, Previous: <a href="#Twiggs-Money-Flow" accesskey="p" rel="prev">Twiggs Money Flow</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbsp; [<a h...
</div>
<h3 class="section" id="Ulcer-Index-1"><span>10.46 Ulcer Index<a class="copiable-link" href="#Ulcer-Index-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-Ulcer-index"></a>
<a class="index-entry-id" id="index-Index_002c-Ulcer"></a>

<p><a class="uref" href="http://www.tangotools.com/ui/ui.htm">http://www.tangotools.com/ui/ui.htm</a>
</p>
<a class="index-entry-id" id="index-Martin_002c-Peter"></a>
<p>The Ulcer Index by Peter Martin is a measure of downside volatility.  For a
given N-day period the closing prices are considered from oldest to newest and
for each close a retracement percentage is calculated, relative to the highest
close so far.



( run in 1.024 second using v1.01-cache-2.11-cpan-df04353d9ac )