App-Chart
view release on metacpan or search on metacpan
lib/App/Chart/doc/chart.html view on Meta::CPAN
</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"> ¶</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’s REMA <br>
Rpp = day before yesterday’s REMA <br>
<em class="math">Lambda</em> is a factor controlling the amount of “regularization”.
</p>
<p>This form shows how there’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’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"> ¶</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’s REMA to today’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"> ¶</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>
– TASC Traders’ 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"> ¶</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 “Low Priority” 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"> ¶</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 “volume factor” 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
lib/App/Chart/doc/chart.html view on Meta::CPAN
In Chart it’s merely the segment of data first displayed.
</p>
<p>The name accumulation/distribution comes from the idea that during
accumulation buyers are in control and the price will be bid up through the
day, or will make a recovery after being sold down, in any case finishing near
the high. Vice versa for distribution.
</p>
<p>Acc/Dist is somewhat similar to On-Balance Volume (see <a class="pxref" href="#On_002dBalance-Volume">On-Balance Volume</a>).
But Acc/Dist looks at close within that day’s range, whereas OBV looks just at
close-to-close up or down. An Acc/Dist calculation within an N-day window can
be made too, see <a class="ref" href="#Chaikin-Money-Flow">Chaikin Money Flow</a>.
</p>
<hr>
</div>
<div class="section-level-extent" id="Accumulative-Swing-Index">
<div class="nav-panel">
<p>
Next: <a href="#Aroon" accesskey="n" rel="next">Aroon</a>, Previous: <a href="#Accumulation_002fDistribution" accesskey="p" rel="prev">Accumulation/Distribution</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Co...
</div>
<h3 class="section" id="Accumulative-Swing-Index-1"><span>10.2 Accumulative Swing Index<a class="copiable-link" href="#Accumulative-Swing-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Accumulative-swing-index"></a>
<a class="index-entry-id" id="index-ASI"></a>
<a class="index-entry-id" id="index-Index_002c-accumulative-swing"></a>
<a class="index-entry-id" id="index-Wilder_002c-J_002e-Welles-2"></a>
<p>The accumulative swing index (ASI) by J. Welles Wilder forms a cumulative
total of certain swing index values which are a tricky weighted combination of
close-to-close, open-to-close, and high-to-low range amounts each day.
</p>
<p>The close-to-close dominates the swing index, so the ASI broadly follows the
shape of the price curve. Wilder recommended looking for trend lines and
breakouts in the ASI to confirm price trend lines.
</p>
<p>The starting point (ie. the zero point) for the running total is arbitrary.
In Chart it’s merely the segment of data first displayed. Wilder’s
calculation applied a scaling factor based on the daily limit move, but this
is not done in Chart. The shape of the resulting curve is not changed by
that.
</p>
<a class="anchor" id="Swing-Index"></a><p>The raw swing index values can be viewed with the “Swing
Index” (which is under “Low Priority” in the indicator lists because it’s
of little direct use).
</p>
<hr>
</div>
<div class="section-level-extent" id="Aroon">
<div class="nav-panel">
<p>
Next: <a href="#Average-True-Range" accesskey="n" rel="next">Average True Range</a>, Previous: <a href="#Accumulative-Swing-Index" accesskey="p" rel="prev">Accumulative Swing Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="Aroon-1"><span>10.3 Aroon<a class="copiable-link" href="#Aroon-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Aroon"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-1"></a>
<p>The Aroon indicator by Tushar Chande shows the length of time since the
highest or lowest close among the past N days’ closes. There are three lines:
Aroon Up for the high, Aroon Down for the low, and the Aroon Oscillator.
</p>
<p>Aroon Up and Down are both expressed as percentages 0 to 100. If today is a
new N-day high then Aroon Up is 100, and for each day that passes (without a
fresh N-day high) it drops by 100/N, down to 0 for no new highs in the past N
days. Conversely for Aroon Down for new N-day lows.
</p>
<p>The Aroon Oscillator is simply the difference between the Up and Down lines,
</p>
<div class="example">
<pre class="example-preformatted">AroonOsc = AroonUp - AroonDown
</pre></div>
<p>In Chart the Up line is drawn in green, the down in red, and the oscillator in
white.
</p>
<hr>
</div>
<div class="section-level-extent" id="Average-True-Range">
<div class="nav-panel">
<p>
Next: <a href="#Centre-of-Gravity-Oscillator" accesskey="n" rel="next">Centre of Gravity Oscillator</a>, Previous: <a href="#Aroon" accesskey="p" rel="prev">Aroon</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#...
</div>
<h3 class="section" id="Average-True-Range-1"><span>10.4 Average True Range<a class="copiable-link" href="#Average-True-Range-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Average-true-range"></a>
<a class="index-entry-id" id="index-ATR"></a>
<a class="index-entry-id" id="index-True-range"></a>
<a class="index-entry-id" id="index-Wilder_002c-J_002e-Welles-3"></a>
<p>Average true range (ATR) by J. Welles Wilder is the daily “true range”
values (see <a class="pxref" href="#True-Range">True Range</a>) smoothed by an N-period exponential moving average
(see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>).
</p>
<div class="example">
<pre class="example-preformatted">ATR = EMA[N] of True Range
</pre></div>
<p>The default smoothing period is 14 days, as recommended by Wilder. The period
is always by Wilder’s reckoning of EMA smoothing period (see <a class="pxref" href="#Wilder-EMA-period">Wilder EMA period</a>).
</p>
<p>The idea behind ATR is that when traders are enthusiastic, either in an
uptrend or downtrend, the range will be higher as the stock or commodity is
bid up or sold down through the day. A lesser range suggests waning interest.
</p>
<p>When a data source doesn’t provide high/low values (some indices for
instance), then just close-to-close changes are used. This may be of limited
use.
</p>
<a class="index-entry-id" id="index-Normalized-ATR"></a>
<a class="anchor" id="Normalized-ATR"></a><ul class="mini-toc">
<li><a href="#Normalized-ATR-1" accesskey="1">Normalized ATR</a></li>
</ul>
<div class="subsection-level-extent" id="Normalized-ATR-1">
<h4 class="subsection"><span>10.4.1 Normalized ATR<a class="copiable-link" href="#Normalized-ATR-1"> ¶</a></span></h4>
<a class="index-entry-id" id="index-Forman_002c-John"></a>
<p>The normalized ATR by John Forman
(<a class="uref" href="http://www.theessentialsoftrading.com">http://www.theessentialsoftrading.com</a>) expresses the ATR as a
percentage of the current closing price. This makes it possible to compare
ATR values over long periods where a share price level (and hence the typical
daily ranges) have changed greatly.
</p>
<div class="example">
<pre class="example-preformatted"> ATR
NATR = 100 * -----
close
</pre></div>
<hr>
</div>
</div>
<div class="section-level-extent" id="Centre-of-Gravity-Oscillator">
<div class="nav-panel">
<p>
Next: <a href="#Chaikin-Money-Flow" accesskey="n" rel="next">Chaikin Money Flow</a>, Previous: <a href="#Average-True-Range" accesskey="p" rel="prev">Average True Range</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a h...
</div>
<h3 class="section" id="Centre-of-Gravity-Oscillator-1"><span>10.5 Centre of Gravity Oscillator<a class="copiable-link" href="#Centre-of-Gravity-Oscillator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Centre-of-gravity-oscillator"></a>
<a class="index-entry-id" id="index-CG"></a>
<a class="index-entry-id" id="index-COG"></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/The%20CG%20Oscillator.pdf">http://www.mesasoftware.com/Papers/The%20CG%20Oscillator.pdf</a>
</p>
<a class="index-entry-id" id="index-Ehlers_002c-John-3"></a>
<p>The Centre of Gravity (CG) oscillator by John Ehlers is a comparison of recent
prices against older prices within a given past N days.
</p>
<p>Prices from those N days are imagined as weights placed on a beam, equally
spaced, and the CG oscillator is then the balance point or centre of gravity
along that beam.
If p1 is today’s price, p2 yesterday’s, etc, then the formula is
</p>
<div class="example">
<pre class="example-preformatted"> 1*p[1] + 2*p[2] + ... + N*p[N]
CG = - ------------------------------
p[1] + p[2] + ... + p[N]
</pre></div>
<p>The “<em class="math">-</em>” sign puts the CG on a scale of <em class="math">-N</em> at the oldest end,
up to <em class="math">-1</em> at the newest prices end. But those extremes are not reached,
instead CG hovers around the midpoint <em class="math">-(N-1)/2</em>. The scale is not
important, only the shape of the curve, which rises if recent prices are
higher, and falls if recent prices are lower.
</p>
<p>Ehlers suggests looking at a past 10 days, and that’s the default. He notes
that if N is very small the CG becomes quite noisy, and that if N is large it
tends to become very unresponsive.
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources-5" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-5">
<h4 class="subsection"><span>10.5.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-5"> ¶</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.linnsoft.com/tour/techind/cog.htm">http://www.linnsoft.com/tour/techind/cog.htm</a> – sample graph of Intel
(symbol ‘<samp class="samp">INTC</samp>’) from 2001/2.
lib/App/Chart/doc/chart.html view on Meta::CPAN
to identify long-term buy signals on a monthly chart.
</p>
<p>The indicator is calculated as the sum of 14-period and 11-period ROC values
(see <a class="pxref" href="#Momentum-and-Rate-of-Change">Momentum</a>), smoothed with a 10-period WMA
(see <a class="pxref" href="#Weighted-Moving-Average">Weighted Moving Average</a>). Adding the two ROCs has the effect of
averaging their values.
</p>
<div class="example">
<pre class="example-preformatted">Coppock = WMA[10] of (ROC[14] + ROC[11])
</pre></div>
<p>Coppock designed the indicator for use on a monthly time scale, which can be
viewed in Chart with <kbd class="key">Ctrl-M</kbd> (see <a class="pxref" href="#Main-Window">Main Window</a>). In other timebases
(days or weeks) Chart uses the same 14, 11 and 10 periods, which may or may
not be useful, since months were what Coppock intended.
</p>
<p>The indicator generates a buy signal for long-term investors when it’s below
zero and turns upwards from a trough. The nature of the calculation means
this will be well after the low in prices, the signal is meant to indicate a
good rally has been established.
</p>
<hr>
</div>
<div class="section-level-extent" id="Detrended-Price-Oscillator">
<div class="nav-panel">
<p>
Next: <a href="#Directional-Movement-Index" accesskey="n" rel="next">Directional Movement Index</a>, Previous: <a href="#Coppock-Curve" accesskey="p" rel="prev">Coppock Curve</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="Detrended-Price-Oscillator-1"><span>10.11 Detrended Price Oscillator<a class="copiable-link" href="#Detrended-Price-Oscillator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Detrended-price-oscillator"></a>
<a class="index-entry-id" id="index-DPO"></a>
<a class="index-entry-id" id="index-Oscillator_002c-detrended-price"></a>
<p>The detrended price oscillator (DPO) aims to eliminate an intermediate or long
term trend and show variations around that trend. It’s calculated on a given
N days using today’s close and a past simple moving average (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>),
</p>
<div class="example">
<pre class="example-preformatted">DPO = close - SMA over N days, as at N/2+1 days ago
</pre></div>
<p>This is somewhat similar to momentum (see <a class="pxref" href="#Momentum-and-Rate-of-Change">Momentum</a>),
but instead of taking the close N days ago, an average (the SMA) of N days
surrounding that point is used.
</p>
<hr>
</div>
<div class="section-level-extent" id="Directional-Movement-Index">
<div class="nav-panel">
<p>
Next: <a href="#Ease-of-Movement" accesskey="n" rel="next">Ease of Movement</a>, Previous: <a href="#Detrended-Price-Oscillator" accesskey="p" rel="prev">Detrended Price Oscillator</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="Directional-Movement-Index-1"><span>10.12 Directional Movement Index<a class="copiable-link" href="#Directional-Movement-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Directional-movement-index"></a>
<a class="index-entry-id" id="index-DMI"></a>
<a class="index-entry-id" id="index-Wilder_002c-J_002e-Welles-4"></a>
<p>The directional movement index by J. Welles Wilder expresses so-called
directional movement, from high to high, or low to low, as a percentage of
true range (see <a class="pxref" href="#True-Range">True Range</a>).
</p>
<p>When today’s high is above yesterday’s high, the increase is upwards
directional movement, written DM+. If today’s high is not above yesterday’s
then DM+ is zero. Conversely when today’s low is less than yesterday’s low
the decrease is downward directional movement, written DM-. Again if today’s
low is not below yesterday’s then DM- is zero. Both DM+ and DM- are positive
numbers, the “+” and “-” signs just refer to the direction of the
movement.
</p>
<p>On an “inside day” where today’s trading range is entirely within
yesterday’s both DM+ and DM- are zero. On an “outside day” where today’s
trading goes both above and below yesterday’s range, only the larger of DM+
and DM- is used and the other is set to zero.
</p>
<p>The two DM+ and DM- series are each smoothed with an N-day exponential moving
average (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) and expressed as a percentage of
average true range (see <a class="pxref" href="#Average-True-Range">Average True Range</a>). The ATR uses the same N-day
EMA smoothing. Two lines are formed, the upwards directional index DI+ and
downwards directional index DI-.
</p>
<div class="example">
<pre class="example-preformatted"> EMA[N] of DM+ EMA[N] of DM+
DI+ = 100 * ------------- DI+ = 100 * -------------
ATR[N] ATR[N]
</pre></div>
<p>In Chart, DI+ is drawn in green (for upwards) and DI- is drawn in red (for
downwards).
</p>
<p>The smoothing N is by Wilder’s reckoning of EMA smoothing period (as discussed
in <a class="ref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), the default is the 14 he recommended.
</p>
<p>An extreme of 100 is approached on DI+ when each day trades entirely above
yesterday’s range (eg. runaway gaps), and then closes at the high of the day.
This is rather rare, usually there’s some pullbacks. Essentially DM+ counts
just the advance, the true range in the denominator counts the backtracking
too. For DI-, an extreme of 100 is approached similarly when each day trades
entirely lower the previous, and closes at its low.
</p>
<a class="index-entry-id" id="index-Average-directional-index"></a>
<a class="index-entry-id" id="index-ADX"></a>
<a class="anchor" id="Average-Directional-Index"></a><ul class="mini-toc">
<li><a href="#Average-Directional-Index-1" accesskey="1">Average Directional Index</a></li>
</ul>
<div class="subsection-level-extent" id="Average-Directional-Index-1">
<h4 class="subsection"><span>10.12.1 Average Directional Index<a class="copiable-link" href="#Average-Directional-Index-1"> ¶</a></span></h4>
<p>The average directional index (ADX) combines DI+ and DI-, expressing their
difference (ignoring the sign) as a percentage of the total, forming a single
line ranging 0 to 100,
</p>
<div class="example">
<pre class="example-preformatted"> abs(DI+ - DI-)
ADX = 100 * --------------
DI+ + DI-
</pre></div>
<hr>
</div>
</div>
<div class="section-level-extent" id="Ease-of-Movement">
<div class="nav-panel">
<p>
Next: <a href="#Elder-Bull_002fBear-Power" accesskey="n" rel="next">Elder Bull/Bear Power</a>, Previous: <a href="#Directional-Movement-Index" accesskey="p" rel="prev">Directional Movement Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">I...
</div>
<h3 class="section" id="Ease-of-Movement-1"><span>10.13 Ease of Movement<a class="copiable-link" href="#Ease-of-Movement-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Ease-of-movement"></a>
<a class="index-entry-id" id="index-Movement_002c-Ease-of"></a>
<a class="index-entry-id" id="index-Arms_002c-Richard"></a>
<p>The ease of movement indicator by Richard Arms shows a ratio of price
movements over volume. Big moves on light volume mean easy movement through
price levels, small moves and/or heavier volume means difficult movement.
</p>
<div class="example">
<pre class="example-preformatted"> midpoint[today] - midpoint[yesterday]
Ease = -------------------------------------
box ratio
</pre></div>
<p>The midpoint is the middle of the day’s trading range,
ie. <em class="math">(high+low)/2</em>. The box ratio is volume over trading range, giving
the amount of volume required to move by one price tick, on the day. Volume
is taken in millions, to bring the scale up (with no effect on the shape).
</p>
<div class="example">
<pre class="example-preformatted"> volume[today]
box ratio = ------------------------
high[today] - low[today]
</pre></div>
<p>Ease of movement is smoothed with an exponential moving average
(see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), with default 14 periods. The raw daily
values can be seen, if desired, by setting the average to 1 day.
</p>
<hr>
</div>
<div class="section-level-extent" id="Elder-Bull_002fBear-Power">
<div class="nav-panel">
<p>
Next: <a href="#Fisher-Transform" accesskey="n" rel="next">Fisher Transform</a>, Previous: <a href="#Ease-of-Movement" accesskey="p" rel="prev">Ease of Movement</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Co...
</div>
<h3 class="section" id="Elder-Bull_002fBear-Power-1"><span>10.14 Elder Bull/Bear Power<a class="copiable-link" href="#Elder-Bull_002fBear-Power-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Elder-bull_002fbear-power"></a>
<a class="index-entry-id" id="index-Bull-power"></a>
<a class="index-entry-id" id="index-Bear-power"></a>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<ul class="mini-toc">
<li><a href="#Additional-Resources-6" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-6">
<h4 class="subsection"><span>10.15.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-6"> ¶</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.linnsoft.com/tour/techind/fish.htm">http://www.linnsoft.com/tour/techind/fish.htm</a> – sample Nasdaq 100
symbol ‘<samp class="samp">QQQ</samp>’ from August 2002. (For Chart use Yahoo symbol ‘<samp class="samp">^IXIC</samp>’
to get that data).
</li></ul>
<hr>
</div>
</div>
<div class="section-level-extent" id="Force-Index">
<div class="nav-panel">
<p>
Next: <a href="#Forecast-Oscillator" accesskey="n" rel="next">Forecast Oscillator</a>, Previous: <a href="#Fisher-Transform" accesskey="p" rel="prev">Fisher Transform</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a hre...
</div>
<h3 class="section" id="Force-Index-1"><span>10.16 Force Index<a class="copiable-link" href="#Force-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Elder-force-index"></a>
<a class="index-entry-id" id="index-Force-index"></a>
<a class="index-entry-id" id="index-Index_002c-force"></a>
<a class="index-entry-id" id="index-EFI"></a>
<a class="index-entry-id" id="index-_0025F"></a>
<a class="index-entry-id" id="index-Elder_002c-Alexander-1"></a>
<p>The force index by Dr. Alexander Elder shows daily close-to-close changes
multiplied by the volume traded, so that moves on greater volume are given
more significance. The raw <em class="math">change*volume</em> values are
smoothed slightly with a 2-day EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), so
the formula is simply
</p>
<div class="example">
<pre class="example-preformatted">Force Index = EMA[2] of (volume * (close - prev close))
</pre></div>
<p>An increasing force index indicates strong interest in an upward move, when it
falls back either price or volume or both have declined suggesting waning
interest. Conversely for a negative and falling force index on the downside.
The smoothing period for the EMA is configurable.
</p>
<hr>
</div>
<div class="section-level-extent" id="Forecast-Oscillator">
<div class="nav-panel">
<p>
Next: <a href="#Gopalakrishnan-Range-Index" accesskey="n" rel="next">Gopalakrishnan Range Index</a>, Previous: <a href="#Force-Index" accesskey="p" rel="prev">Force Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a...
</div>
<h3 class="section" id="Forecast-Oscillator-1"><span>10.17 Forecast Oscillator<a class="copiable-link" href="#Forecast-Oscillator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Forecast-oscillator"></a>
<a class="index-entry-id" id="index-Oscillator_002c-forecast"></a>
<a class="index-entry-id" id="index-FOSC"></a>
<a class="index-entry-id" id="index-_0025F-1"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-3"></a>
<p>The %F forecast oscillator by Tushar Chande shows deviation between today’s
closing price and an N-day linear regression forecast (see <a class="pxref" href="#Linear-Regression">Linear Regression</a>) of that close. The deviation is expressed as a percentage of the
close, so the formula is
</p>
<div class="example">
<pre class="example-preformatted"> close - forecast
%F = ---------------- * 100
close
forecast = linear regression of previous N days, at today
</pre></div>
<p>The N days prices for the linear regression start from yesterday’s close, and
the forecast value is the line extended out to today. This forecast line is
like the EPMA (see <a class="pxref" href="#Endpoint-Moving-Average">Endpoint Moving Average</a>), but going out one day
further. Chande suggests using a 5 day regression for short term trading, and
that’s the default in Chart.
</p>
<hr>
</div>
<div class="section-level-extent" id="Gopalakrishnan-Range-Index">
<div class="nav-panel">
<p>
Next: <a href="#Intraday-Momentum-Index" accesskey="n" rel="next">Intraday Momentum Index</a>, Previous: <a href="#Forecast-Oscillator" accesskey="p" rel="prev">Forecast Oscillator</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="Gopalakrishnan-Range-Index-1"><span>10.18 Gopalakrishnan Range Index<a class="copiable-link" href="#Gopalakrishnan-Range-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Gopalakrishnan-range-index"></a>
<a class="index-entry-id" id="index-Index_002c-Gopalakrishnan-range"></a>
<a class="index-entry-id" id="index-GAPO"></a>
<a class="index-entry-id" id="index-Gopalakrishnan_002c-Jayanthi"></a>
<p>The Gopalakrishnan Range Index (GAPO) by Jayanthi Gopalakrishnan quantifies
the variability in a stock, based on the logarithm of the trading range over
an N-day period (default 5 days).
</p>
<div class="example">
<pre class="example-preformatted"> log(high[Ndays] - low[Ndays])
GAPO = -----------------------------
log(N)
</pre></div>
<p>The idea is to identify markets which are more erratic than others. It will
be noted though that there’s no scaling to the overall price level. In Chart
GAPO is under “Low Priority” in the indicator lists.
</p>
<hr>
</div>
<div class="section-level-extent" id="Intraday-Momentum-Index">
<div class="nav-panel">
<p>
Next: <a href="#Klinger-Volume-Oscillator" accesskey="n" rel="next">Klinger Volume Oscillator</a>, Previous: <a href="#Gopalakrishnan-Range-Index" accesskey="p" rel="prev">Gopalakrishnan Range Index</a>, Up: <a href="#Indicators" accesskey="u" rel="u...
</div>
<h3 class="section" id="Intraday-Momentum-Index-1"><span>10.19 Intraday Momentum Index<a class="copiable-link" href="#Intraday-Momentum-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Intraday-momentum-index"></a>
<a class="index-entry-id" id="index-Index_002c-Intraday-momentum"></a>
<a class="index-entry-id" id="index-IMI"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-4"></a>
<p>The intraday momentum index (IMI) by Tushar Chande expresses upward
open-to-close movement in the past N days as percentage of total open-to-close
movement (up and down).
</p>
<div class="example">
<pre class="example-preformatted"> Sum[N] of max(close-open, 0)
IMI = ----------------------------
Sum[N] of abs(close-open)
</pre></div>
<p>This is like an RSI (see <a class="pxref" href="#Relative-Strength-Index">Relative Strength Index</a>) but on open-to-close
movement and with a simple moving average.
</p>
<p>The use of open-to-close is also similar to the way QStick
(see <a class="pxref" href="#QStick">QStick</a>) shows proportions of black and white candlesticks, with IMI
scaling according to the total real-body height in the past N days.
</p>
<hr>
</div>
<div class="section-level-extent" id="Klinger-Volume-Oscillator">
<div class="nav-panel">
<p>
Next: <a href="#MACD" accesskey="n" rel="next">MACD</a>, Previous: <a href="#Intraday-Momentum-Index" accesskey="p" rel="prev">Intraday Momentum Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-Inde...
</div>
<h3 class="section" id="Klinger-Volume-Oscillator-1"><span>10.20 Klinger Volume Oscillator<a class="copiable-link" href="#Klinger-Volume-Oscillator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Klinger-volume-oscillator"></a>
<a class="index-entry-id" id="index-KVO"></a>
<a class="index-entry-id" id="index-KO"></a>
<a class="index-entry-id" id="index-Oscillator_002c-Klinger-volume"></a>
<a class="index-entry-id" id="index-Klinger_002c-Stephen-J_002e"></a>
<p>The Klinger volume oscillator (KVO) by Stephen J. Klinger is based on
cumulative volume, with volume added or subtracted according to the direction
of typical price and weighted by a certain daily range calculation.
</p>
<p>A trend direction is determined from today and yesterday’s “typical prices”
(which are <em class="math">(high+low+close)/3</em>),
</p>
<div class="example">
<pre class="example-preformatted">trend = / 1 if TP[today] > TP[yesterday]
\ -1 if TP[today] <= TP[yesterday]
</pre></div>
<p>A daily measurement <em class="math">DM = high-low</em> is calculated and then a cumulative
measurement formed (cumulative while the trend direction is the same),
</p>
<div class="example">
<pre class="example-preformatted">CM[today] = / CM[yesterday] + DM[today] if trend[today]==trend[yester]
\ DM[yesterday] + DM[today] if trend[today]!=trend[yester]
</pre></div>
<p>A “volume force” is then formed by accumulating volume amounts, with the
“trend” factor making them add or subtract according to the typical price
direction, and with the values scaled by DM and CM.
</p>
<div class="example">
<pre class="example-preformatted">VF = volume * trend * abs(2*DM/CM - 1)
</pre></div>
<p>The Klinger oscillator is then formed as the difference between fast (34-day)
and slow (55-day) EMAs (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) of the volume
lib/App/Chart/doc/chart.html view on Meta::CPAN
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> [<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"> ¶</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’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 “reversal bulge” 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"> ¶</a></span></h3>
<p>Applying an EMA a second time gives a quite different result from a plain
EMA. It’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’ 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 “Low Priority” 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> [<a href="#Concept-Index"...
</div>
<h3 class="section" id="Momentum"><span>10.24 Momentum<a class="copiable-link" href="#Momentum"> ¶</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’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"> ¶</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> – Formula and
sample on Polish WIG20 from 2000.
</li></ul>
<hr>
</div>
</div>
<div class="section-level-extent" id="Money-Flow-Index">
<div class="nav-panel">
<p>
Next: <a href="#On_002dBalance-Volume" accesskey="n" rel="next">On-Balance Volume</a>, Previous: <a href="#Momentum-and-Rate-of-Change" accesskey="p" rel="prev">Momentum</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a ...
</div>
<h3 class="section" id="Money-Flow-Index-1"><span>10.25 Money Flow Index<a class="copiable-link" href="#Money-Flow-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Money-Flow-Index"></a>
<a class="index-entry-id" id="index-MFI"></a>
<a class="index-entry-id" id="index-Index_002c-money-flow"></a>
<p>The Money Flow Index (MFI) ranges from 0 to 100 showing dollar volume
(referred to as “money flow”) on up days as a percentage of total up and
down days, in a given past N days.
</p>
<p>The calculation is as follows. A “typical price” is formed from the average
of high, low and close. If high/low figures are not available then Chart just
uses the close,
</p>
<div class="example">
<pre class="example-preformatted"> high + low + close
typical price = ------------------
3
</pre></div>
<p>“Money flow” on a given day is typical price multiplied by volume. This is
the money that flowed, ie. an approximation to the dollar volume traded.
</p>
<div class="example">
<pre class="example-preformatted">money flow = typical price * volume
</pre></div>
<p>Across the N-day period two totals are formed. “Positive money flow” is the
money flow on days where the typical price is higher the previous day’s
typical price, and “negative money flow” when below. Days when typical
price is unchanged are ignored. The MFI is then
</p>
<div class="example">
<pre class="example-preformatted"> positive money flow
MFI = 100 * -----------------------------------------
positive money flow + negative money flow
</pre></div>
<p>Generally an MFI level of 80 is considered overbought, and 20 considered
oversold. Those levels are shown as shown as dashed lines.
</p>
<p>MFI is similar to RSI (see <a class="pxref" href="#Relative-Strength-Index">Relative Strength Index</a>) in its construction
and use. Both are looking at up days versus totalled up and down days, but
the RSI scales by price change amounts where MFI scales on dollar volume (or
an approximation to that).
</p>
<p>It should be noted “money flow” refers to dollar volume, ie. the total value
of shares traded. Sometimes finance commentators speak of money “flowing
into” a stock, but that expression only means buyers are enthusiastic.
Obviously there’s never any net money in or out, because for every buyer
there’s a seller of the same amount.
</p>
<p>For the purposes of the MFI, “money flow”, ie. dollar volume, on an up day
is taken to represent the enthusiasm of buyers, and on a down day to
represent the enthusiasm of sellers. An excessive proportion in one direction
or the other is interpreted as an extreme, likely to result in a price
reversal.
</p>
<hr>
</div>
<div class="section-level-extent" id="On_002dBalance-Volume">
<div class="nav-panel">
<p>
Next: <a href="#Negative-Volume-Index" accesskey="n" rel="next">Negative Volume Index</a>, Previous: <a href="#Money-Flow-Index" accesskey="p" rel="prev">Money Flow Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a...
</div>
<h3 class="section" id="On_002dBalance-Volume-1"><span>10.26 On-Balance Volume<a class="copiable-link" href="#On_002dBalance-Volume-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-On_002dbalance-volume"></a>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<a class="index-entry-id" id="index-Volume_002c-on_002dbalance"></a>
<p>On-balance volume (OBV) is a running total of daily volume, with volume on an
up day added and volume on a down day subtracted. An up day is a close higher
than the previous day’s close, and vice versa a down day. So if p1 is
today’s close and p2 is yesterday’s, the formula is simply
</p>
<div class="example">
<pre class="example-preformatted"> / v1 if p1 > p2
|
OBV = OBVprev + | 0 if p1 = p2
|
\ - v1 if p1 > p2
</pre></div>
<p>The starting point (ie. the zero point) for the running total is arbitrary.
In Chart it’s merely the segment of data first displayed.
</p>
<p>See also <a class="ref" href="#Price-and-Volume-Trend">Price and Volume Trend</a>, and <a class="ref" href="#Accumulation_002fDistribution">Accumulation/Distribution</a>,
which accumulate volume in similar ways.
</p>
<hr>
</div>
<div class="section-level-extent" id="Negative-Volume-Index">
<div class="nav-panel">
<p>
Next: <a href="#Polarized-Fractal-Efficiency" accesskey="n" rel="next">Polarized Fractal Efficiency</a>, Previous: <a href="#On_002dBalance-Volume" accesskey="p" rel="prev">On-Balance Volume</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indic...
</div>
<h3 class="section" id="Negative-Volume-Index-1"><span>10.27 Negative Volume Index<a class="copiable-link" href="#Negative-Volume-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Negative-volume-index"></a>
<a class="index-entry-id" id="index-NVI"></a>
<a class="index-entry-id" id="index-Index_002c-negative-volume"></a>
<a class="index-entry-id" id="index-Fosback_002c-Norman"></a>
<p>The Negative Volume Index (NVI) and Positive Volume Index (PVI) by Norman
Fosback (<a class="uref" href="http://www.fosback.com">http://www.fosback.com</a>) track price changes according to
changes in volume. The NVI tracks closing price changes that occur on days
with lower volume than yesterday, and the PVI conversely tracks those with
higher volume than yesterday.
</p>
<div class="example">
<pre class="example-preformatted"> / close
| ----------- if vol < vol[prev]
NVI = NVI[prev] * | close[prev]
|
\ 1 if vol >= vol[prev]
</pre></div>
<div class="example">
<pre class="example-preformatted"> / close
| ----------- if vol > vol[prev]
PVI = PVI[prev] * | close[prev]
|
\ 1 if vol <= vol[prev]
</pre></div>
<p>The fraction <em class="math">close/close[prev]</em> means that the indices
follow percentage daily changes in the closing prices, but only changes on the
selected lower or higher volume days are used. The starting point for the
changes is arbitrary, only the shape of the resulting line matters. In Chart
the start is 100 for the first data portion displayed.
</p>
<p>The principle behind the NVI is that on high volume days an uninformed crowd
is dominating, whereas on quieter days “smart money” is establishing
positions. Fosback holds there’s a 95% probability of a bull market when the
NVI rises above its one-year moving average.
</p>
<hr>
</div>
<div class="section-level-extent" id="Polarized-Fractal-Efficiency">
<div class="nav-panel">
<p>
Next: <a href="#Pretty-Good-Oscillator" accesskey="n" rel="next">Pretty Good Oscillator</a>, Previous: <a href="#Negative-Volume-Index" accesskey="p" rel="prev">Negative Volume Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a...
</div>
<h3 class="section" id="Polarized-Fractal-Efficiency-1"><span>10.28 Polarized Fractal Efficiency<a class="copiable-link" href="#Polarized-Fractal-Efficiency-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Polarized-fractal-efficiency"></a>
<a class="index-entry-id" id="index-PFE"></a>
<a class="index-entry-id" id="index-Fractal_002c-polarized-efficiency-indicator"></a>
<p>The Polarized Fractal Efficiency indicator by Hans Hannula shows how
efficient, meaning how much like a straight line, the price movement has been
over the past N days.
</p>
<p>The net distance travelled over the past N days is expressed as a percentage
of the total of each day’s distance travelled. Distance is measured in
two-dimensions, like a ruler on the plotted graph. Rise (or fall) is
expressed as a percentage, and each day counts as 1 unit across. So the
formula, on closing prices p1 (today) to pN is
</p>
<div class="example">
<pre class="example-preformatted"> Sign(p1-pN) * Hypot(N-1, Pchg(p1,pN))
PFE = 100 * -------------------------------------------------------
Hypot(1, Pchg(p1,p2)) + ... + Hypot(1, Pchg(p[N-1],pN))
Sign(X) = 1 if X>0, or -1 if X<0
new - old
Pchg(new,old) = 100 * ---------
old
Hypot(x,y) = sqrt (x^2 + y^2)
</pre></div>
<p>Here “Pchg” is a percentage change up or down from “new” to “old” price,
and “Hypot” is the distance (the hypotenuse) for a move of X horizontally
and Y vertically. “Sign” means that PFE is positive or negative according
to whether the change over the past N days is up or down.
</p>
<p>At the extremes of 100 or -100, price movement is at maximum efficiency, with
the past N days making a perfectly straight line. An almost straight line is
generally very close to 100 too. A midpoint of 0 means there’s been no net
change over the past N days.
</p>
<p>Hannula looked at price changes over 10 day period (horizontal distance of 9),
and this is the default in Chart. A smoothing parameter is provided too; it
applies an exponential moving average (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) to
the PFE. The default is 5 days smoothing, a value of 0 means no smoothing
(to see the raw values).
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources-8" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-8">
<h4 class="subsection"><span>10.28.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-8"> ¶</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.traderslog.com/polarized-fractal-efficiency.htm">http://www.traderslog.com/polarized-fractal-efficiency.htm</a> – sample
chart of IBM, year not shown but data is 2002.
</li><li><a class="uref" href="http://transcripts.fxstreet.com/2005/09/polarized_fract.html">http://transcripts.fxstreet.com/2005/09/polarized_fract.html</a> –
presentation on PFE by Erik Long.
</li></ul>
<hr>
</div>
</div>
<div class="section-level-extent" id="Pretty-Good-Oscillator">
<div class="nav-panel">
<p>
Next: <a href="#Price-and-Volume-Trend" accesskey="n" rel="next">Price and Volume Trend</a>, Previous: <a href="#Polarized-Fractal-Efficiency" accesskey="p" rel="prev">Polarized Fractal Efficiency</a>, Up: <a href="#Indicators" accesskey="u" rel="up"...
</div>
<h3 class="section" id="Pretty-Good-Oscillator-1"><span>10.29 Pretty Good Oscillator<a class="copiable-link" href="#Pretty-Good-Oscillator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Pretty-good-oscillator"></a>
<a class="index-entry-id" id="index-PGO"></a>
<a class="index-entry-id" id="index-Oscillator_002c-pretty-good"></a>
<p>The “Pretty Good Oscillator” (PGO) by Mark Johnson measures the distance of
the current close from its N-day simple moving average (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>), expressed in terms of an average true range (see <a class="pxref" href="#Average-True-Range">Average True Range</a>...
</p>
<div class="example">
<pre class="example-preformatted"> close - SMA[N] of closes
PGO = ------------------------
EMA[N] of true range
</pre></div>
<p>So for instance a PGO value of +2.5 would mean the current close is 2.5
average days’ range above the SMA.
</p>
<p>Johnson’s approach was to use it as a breakout system for longer term trades.
If the PGO rises above 3.0 then go long, or below -3.0 then go short, and in
both cases exit on returning to zero (which is a close back at the SMA).
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources-9" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-9">
<h4 class="subsection"><span>10.29.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-9"> ¶</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://trader.online.pl/MSZ/e-w-Pretty_Good_Oscillator.html">http://trader.online.pl/MSZ/e-w-Pretty_Good_Oscillator.html</a> – formula,
and sample chart of Cisco (‘<samp class="samp">CSCO</samp>’) from 2003.
</li></ul>
<hr>
</div>
</div>
<div class="section-level-extent" id="Price-and-Volume-Trend">
<div class="nav-panel">
<p>
Next: <a href="#QStick" accesskey="n" rel="next">QStick</a>, Previous: <a href="#Pretty-Good-Oscillator" accesskey="p" rel="prev">Pretty Good Oscillator</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-In...
</div>
<h3 class="section" id="Price-and-Volume-Trend-1"><span>10.30 Price and Volume Trend<a class="copiable-link" href="#Price-and-Volume-Trend-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Price-and-volume-trend"></a>
<a class="index-entry-id" id="index-PVT"></a>
<a class="index-entry-id" id="index-Volume_002c-price-trend"></a>
<p>Price and Volume Trend (PVT) is a running total of daily volume, with each
day’s volume added or subtracted according to the percentage change in the
today’s closing price over yesterday’s.
</p>
<div class="example">
<pre class="example-preformatted"> close[today] - close[yesterday]
PVT = PVTprev + volume * -------------------------------
close[yesterday]
</pre></div>
<p>The starting point (ie. the zero point) for the running total is arbitrary.
In Chart it’s merely the segment of data first displayed.
</p>
<p>PVT is similar to On-balance volume (see <a class="pxref" href="#On_002dBalance-Volume">On-Balance Volume</a>), but
accumulating a portion of the volume. And see also
<a class="ref" href="#Accumulation_002fDistribution">Accumulation/Distribution</a>, which also accumulates volume.
</p>
<hr>
</div>
<div class="section-level-extent" id="QStick">
<div class="nav-panel">
<p>
Next: <a href="#R_002dSquared-Index" accesskey="n" rel="next">R-Squared Index</a>, Previous: <a href="#Price-and-Volume-Trend" accesskey="p" rel="prev">Price and Volume Trend</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="QStick-1"><span>10.31 QStick<a class="copiable-link" href="#QStick-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-QStick"></a>
<p>The QStick indicator shows the dominance of black (down) or white (up)
candlesticks, which are red and green in Chart, as represented by the average
open to close change for each of past N days.
</p>
<div class="example">
<pre class="example-preformatted"> close[1]-open[1] + ... + close[N]-open[N]
QStick = -----------------------------------------
N
</pre></div>
<p>Days which are up have positive amounts for <em class="math">close-open</em>, days which are
down have negative amounts. In adding them up they cancel out until the
dominance of one over the other results.
</p>
<hr>
</div>
<div class="section-level-extent" id="R_002dSquared-Index">
<div class="nav-panel">
<p>
Next: <a href="#RAVI" accesskey="n" rel="next">RAVI</a>, Previous: <a href="#QStick" accesskey="p" rel="prev">QStick</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-Index" title="Index" rel="index">Index...
</div>
<h3 class="section" id="R_002dSquared-Index-1"><span>10.32 R-Squared Index<a class="copiable-link" href="#R_002dSquared-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-R_002dsquared-index"></a>
<a class="index-entry-id" id="index-Index_002c-R_002dSquared"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-5"></a>
<a class="index-entry-id" id="index-Kroll_002c-Stanley-1"></a>
<a class="index-entry-id" id="index-Correlation-coefficient"></a>
<a class="index-entry-id" id="index-Coefficient_002c-correlation"></a>
<a class="index-entry-id" id="index-Coefficient-of-determination"></a>
<p>The R-squared indicator by Tushar Chande and Stanley Kroll is a measure of how
closely the past N days resemble a straight line, ie. a trend. It
calculates what is called in statistics the <em class="dfn">coefficient of determination</em>
of the prices versus a straight line. This coefficient is written <em class="math">r^2</em>,
hence the name of the indicator.
</p>
<p>For reference, the formulas are as follows, where X values are the closing
prices and Y values are a straight line 1,2,…,N. Variance is the
square of standard deviation (see <a class="pxref" href="#Standard-Deviation">Standard Deviation</a>).
</p>
<div class="example">
<pre class="example-preformatted"> (Covariance X,Y)^2
r^2 = -----------------------
Variance X * Variance Y
Covariance X,Y = Mean (X*Y) - (Mean X) * (Mean Y)
Variance X = Mean(X^2) - (Mean X)^2
</pre></div>
<p>The R-squared indicator ranges from 0 meaning no apparent correlation to the
straight line, up to 1 for perfect correlation. The slope of the closing
prices line doesn’t matter, nor does the absolute price level, only how well
they make a straight line.
</p>
<p>Chande and Kroll suggested using a 14-day period, and that’s the default in
Chart.
</p>
<hr>
</div>
<div class="section-level-extent" id="RAVI">
<div class="nav-panel">
<p>
Next: <a href="#Relative-Strength-Index" accesskey="n" rel="next">Relative Strength Index</a>, Previous: <a href="#R_002dSquared-Index" accesskey="p" rel="prev">R-Squared Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbs...
</div>
<h3 class="section" id="RAVI-1"><span>10.33 RAVI<a class="copiable-link" href="#RAVI-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-RAVI"></a>
<p>RAVI is a simple indicator showing whether a stock is trending. It calculates
the percentage difference between current prices and older prices. Current
prices are represented by a short SMA and the longer time frame by a long SMA
(see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>). The defaults are 7 days and 65 days.
</p>
<div class="example">
<pre class="example-preformatted"> abs (SMA[short] - SMA[long])
RAVI = 100 * ----------------------------
SMA[long]
</pre></div>
<hr>
</div>
<div class="section-level-extent" id="Relative-Strength-Index">
<div class="nav-panel">
<p>
Next: <a href="#Relative-Volatility-Index" accesskey="n" rel="next">Relative Volatility Index</a>, Previous: <a href="#RAVI" accesskey="p" rel="prev">RAVI</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-...
</div>
<h3 class="section" id="Relative-Strength-Index-1"><span>10.34 Relative Strength Index<a class="copiable-link" href="#Relative-Strength-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Relative-strength-index"></a>
<a class="index-entry-id" id="index-RSI"></a>
<a class="index-entry-id" id="index-Index_002c-relative-strength"></a>
<a class="index-entry-id" id="index-Wilder_002c-J_002e-Welles-5"></a>
<p>The Relative Strength Index (RSI) by J. Welles Wilder compares average
upward close-to-close movement against all close-to-close movement, each
smoothed by an EMA (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>).
</p>
<p>For each day an upward or downward movement is calculated. On an up day
</p>
<div class="example">
<pre class="example-preformatted">U = close[today] - close[yesterday]
D = 0
</pre></div>
<p>or on a down day as follows (notice D is a positive amount),
</p>
<div class="example">
<pre class="example-preformatted">U = 0
D = close[yesterday] - close[today]
</pre></div>
<p>The sequence of U values over time is averaged with an EMA
(see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) and likewise the D values. The
ratio is the “relative strength”,
</p>
<div class="example">
<pre class="example-preformatted"> EMA[N] of U
RS = -----------
EMA[N] of D
</pre></div>
<p>This is turned into an index between 0 and 100,
</p>
<div class="example">
<pre class="example-preformatted"> 1
RSI = 100 * ------
1 + RS
</pre></div>
<p>This can also be written as follows, emphasising the way the RSI measures up
lib/App/Chart/doc/chart.html view on Meta::CPAN
<div class="section-level-extent" id="Random-Walk-Index">
<div class="nav-panel">
<p>
Next: <a href="#Stochastics" accesskey="n" rel="next">Stochastics</a>, Previous: <a href="#Relative-Volatility-Index" accesskey="p" rel="prev">Relative Volatility Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a h...
</div>
<h3 class="section" id="Random-Walk-Index-1"><span>10.37 Random Walk Index<a class="copiable-link" href="#Random-Walk-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Random-walk-index"></a>
<a class="index-entry-id" id="index-Index_002c-random-walk"></a>
<a class="index-entry-id" id="index-RWI"></a>
<p>The random walk index (RWI) by E. Michael Poulos is a measure of how much
price ranges over N days differ from what would be expected by a random walk
(randomly going up and down). A bigger than expected range suggests a trend.
</p>
<p>The index is in two parts, an RWI high which looks at upward movement and an
RWI low for downward movement. In Chart RWI high is shown in green, and RWI
low in red. The RWI high looks at terms like
</p>
<div class="example">
<pre class="example-preformatted">High[today] - Low[K] 1
-------------------- * ------
Average TR [K] sqrt(K)
</pre></div>
<p>which is the move from the low K days ago up to today’s high, scaled by an
average of the true range (TR, see <a class="pxref" href="#True-Range">True Range</a>). Such terms are calculated
for each number of days 2, 3, etc, up to the given RWI parameter N, and the
maximum is the RWI. The first term for instance is today’s high less
yesterday’s low, compared to a two-day average of the true range (yesterday’s
true range and the day before’s). RWI low is similar, but using <em class="math">High[K]
- Low[today]</em> for the movement down from past high to today’s low.
</p>
<p>The factor <em class="math">sqrt(K)</em> compares the movement to a random walk. If a
random walk has a 50% chance of going up by one, or a 50% chance of going down
by one, then it can be shown that on average the distance travelled after K
steps is <em class="math">sqrt(K)</em>. So the formula compares observed distance in
average day’s steps compared to the <em class="math">sqrt(K)</em> steps which would be
the expected move if it were random. Thus 1 is when movement is apparently
random, and higher or lower if some apparently non-random trend or lack of
trend (respectively) appears to be present.
</p>
<hr>
</div>
<div class="section-level-extent" id="Stochastics">
<div class="nav-panel">
<p>
Next: <a href="#TD-Range-Expansion-Index" accesskey="n" rel="next">TD Range Expansion Index</a>, Previous: <a href="#Random-Walk-Index" accesskey="p" rel="prev">Random Walk Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &n...
</div>
<h3 class="section" id="Stochastics-1"><span>10.38 Stochastics<a class="copiable-link" href="#Stochastics-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Stochastics"></a>
<a class="index-entry-id" id="index-Lane_002c-George"></a>
<p>Stochastics are an oscillator and signal line described by George Lane based
on each day’s close within the total trading range of past N days. This
should not be confused with stochastic processes etc in mathematics, the two
are unrelated.
</p>
<a class="index-entry-id" id="index-_0025K-stochastic"></a>
<p>The %K line is the close position within the past N-days trading range
(highest high to lowest low) expressed as a percentage 0 to 100.
</p>
<div class="example">
<pre class="example-preformatted"> close - Nday low
%K = 100 * --------------------
Nday high - Nday low
</pre></div>
<a class="index-entry-id" id="index-_0025D-stochastic"></a>
<p>An extreme of 0 is reached for a close at the day’s low which is also a new
N-day low. Likewise 100 for a close at the day’s high and a new N-day high.
A signal line %D is added by smoothing %K with a simple moving average
(see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>).
</p>
<div class="example">
<pre class="example-preformatted">%D = SMA[D] of %K
</pre></div>
<p>The default periods in chart are 14 days for %K, and 3 days smoothing for %D.
The %K line is drawn in red and the %D line in green.
</p>
<a class="index-entry-id" id="index-Fast-stochastics"></a>
<a class="index-entry-id" id="index-Slow-stochastics"></a>
<p>%K and %D just described are called the “fast” stochastics. Corresponding
“slow” stochastics are formed by smoothing %K with a simple moving average,
and calculating %D from that smoothed series. The extra smoothing is the
“slow days” parameter in Chart. The default is 0 for no slowing, a value of
3 is often used.
</p>
<p>Incidentally, a value of 1 for the slowing is the same as no slowing, because
a 1-period SMA of course doesn’t change the data.
</p>
<hr>
</div>
<div class="section-level-extent" id="TD-Range-Expansion-Index">
<div class="nav-panel">
<p>
Next: <a href="#Trend-Intensity-Index" accesskey="n" rel="next">Trend Intensity Index</a>, Previous: <a href="#Stochastics" accesskey="p" rel="prev">Stochastics</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Co...
</div>
<h3 class="section" id="TD-Range-Expansion-Index-1"><span>10.39 TD Range Expansion Index<a class="copiable-link" href="#TD-Range-Expansion-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-TD-range-expansion-index"></a>
<a class="index-entry-id" id="index-Range-expansion-index"></a>
<a class="index-entry-id" id="index-TDREI"></a>
<a class="index-entry-id" id="index-DeMark_002c-Tom"></a>
<p>The range expansion index by Tom DeMark is designed to identify price
exhaustion which may be the end of a move up or down.
</p>
<p>The calculation is somewhat similar to an RSI (see <a class="pxref" href="#Relative-Strength-Index">Relative Strength Index</a>) but looks at 2-day changes in the daily high and daily low values and
smooths with a 5-day SMA (see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>). Changes are ignored
if the current day in not either within or covering price action from 5 or 6
days ago. That test effectively holds the indicator around zero while prices
are making breakaway runs.
</p>
<p>DeMark regarded values above <em class="math">+45</em> or below <em class="math">-45</em> as overbought or
oversold. Such a reading maintained for up to five days suggests a reversal,
except that if it remains there for 6 or more days then the signal may be
unreliable and trading should be avoided.
</p>
<hr>
</div>
<div class="section-level-extent" id="Trend-Intensity-Index">
<div class="nav-panel">
<p>
Next: <a href="#Trendscore" accesskey="n" rel="next">Trendscore</a>, Previous: <a href="#TD-Range-Expansion-Index" accesskey="p" rel="prev">TD Range Expansion Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href=...
</div>
<h3 class="section" id="Trend-Intensity-Index-1"><span>10.40 Trend Intensity Index<a class="copiable-link" href="#Trend-Intensity-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Trend-intensity-index"></a>
<a class="index-entry-id" id="index-TII"></a>
<a class="index-entry-id" id="index-Pee_002c-M_002e-H_002e"></a>
<p>The trend intensity index (TII) by M. H. Pee measures the strength of a
trend, by looking at what proportion of the past 30 days prices have been
above or below the level of today’s 60-day simple moving average
(see <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>).
</p>
<p>The 60-day average is as of today, not its past values at each of
those past 30 days. For each day the deviation <em class="math">close-avg</em> is
taken. Positive amounts are up deviations, and negative amounts have
the sign discarded and are down deviations.
</p>
<div class="example">
<pre class="example-preformatted">up = / close - average if close > average
\ 0 otherwise
down = / average - close if average < close
\ 0 otherwise
</pre></div>
<p>The percentage of the total up amounts out of total up and down amounts is
then the trend intensity index,
</p>
<div class="example">
<pre class="example-preformatted"> total up
TDI = 100 * ---------------------
total up + total down
</pre></div>
<p>The extreme of 100 occurs when all closes in the past 30 days have been above
today’s 60-day moving average level, and conversely the extreme of 0 when all
below that level.
</p>
<p>Visually the index is like looking at the area under the graph of prices. The
area above a horizontal line at today’s 60-day moving average is the up
amounts, the area below it is the down amounts, and the index is the fraction
of the up out of the total.
</p>
<p>Pee recommended entering trades when levels of 80 on the upside or 20 on the
downside are reached. Lines are shown in Chart at those levels, as is 50
which is a neutral level.
</p>
<p>The 60 and 30 days are configurable (see <a class="pxref" href="#View-Style">View Style</a>). Any values are
accepted, but it probably doesn’t make much sense to have the MA period (60)
shorter than the deviations period (30). Certainly it makes no sense to have
the two equal, because the up deviations are then always exactly 50% of the
total.
</p>
<hr>
</div>
<div class="section-level-extent" id="Trendscore">
<div class="nav-panel">
<p>
Next: <a href="#True-Strength-Index" accesskey="n" rel="next">True Strength Index</a>, Previous: <a href="#Trend-Intensity-Index" accesskey="p" rel="prev">Trend Intensity Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbs...
</div>
<h3 class="section" id="Trendscore-1"><span>10.41 Trendscore<a class="copiable-link" href="#Trendscore-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Trendscore"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-6"></a>
<p>Trendscore by Tushare Chande<a class="footnote" id="DOCF1" href="#FOOT1"><sup>1</sup></a> rates the
strength of a trend. The calculation is quite simple, today’s close is
compared to each close at 11 through 20 days ago and scored <em class="math">+1</em> for each
it’s above and <em class="math">-1</em> if below.
</p>
<div class="example">
<pre class="example-preformatted">Trendscore = if close >= close[11] then +1 else -1
+ if close >= close[12] then +1 else -1
...
+ if close >= close[12] then +1 else -1
</pre></div>
<p>The result is a rating between <em class="math">+10</em> or <em class="math">-10</em> for how many of those
past days the current close is above. The high of <em class="math">+10</em> is when above
all those past prices, or <em class="math">-10</em> when below them all. In a good trend up
or down those extremes are often reached.
</p>
<hr>
</div>
<div class="section-level-extent" id="True-Strength-Index">
<div class="nav-panel">
<p>
Next: <a href="#TRIX" accesskey="n" rel="next">TRIX</a>, Previous: <a href="#Trendscore" accesskey="p" rel="prev">Trendscore</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-Index" title="Index" rel="inde...
</div>
<h3 class="section" id="True-Strength-Index-1"><span>10.42 True Strength Index<a class="copiable-link" href="#True-Strength-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-True-strength-index"></a>
<a class="index-entry-id" id="index-Index_002c-True-strength"></a>
<a class="index-entry-id" id="index-TSI"></a>
<a class="index-entry-id" id="index-Blau_002c-William"></a>
<p>The true strength index (TSI) by William Blau<a class="footnote" id="DOCF2" href="#FOOT2"><sup>2</sup></a> is
variation of the RSI (see <a class="pxref" href="#Relative-Strength-Index">Relative Strength Index</a>) using two EMAs to
smooth (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), and a scale <em class="math">-100</em> to
<em class="math">+100</em>.
</p>
<div class="example">
<pre class="example-preformatted"> EMA[13] of EMA[25] of (close - prevclose)
TSI = 100 * --------------------------------------------
EMA[13] of EMA[25] of abs(close - prevclose)
</pre></div>
<p>The TSI ranges from <em class="math">-100</em> up to <em class="math">+100</em> with positive values
representing upward momentum and negative values downward momentum. Extreme
values can be interpreted as overbought and oversold, as per the ordinary RSI.
</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’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> [<a h...
</div>
<h3 class="section" id="TRIX-1"><span>10.43 TRIX<a class="copiable-link" href="#TRIX-1"> ¶</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’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"> ¶</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’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’ 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> [<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"> ¶</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’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> [<a h...
</div>
<h3 class="section" id="Ulcer-Index-1"><span>10.46 Ulcer Index<a class="copiable-link" href="#Ulcer-Index-1"> ¶</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.
</p>
<div class="example">
<pre class="example-preformatted"> price[i] - maxprice so far
R[i] = --------------------------
maxprice so far
</pre></div>
<a class="index-entry-id" id="index-Quadratic-mean"></a>
<a class="index-entry-id" id="index-Mean_002c-quadratic"></a>
<p>So for instance a price $5.00 falling back to $4.50 is a -10% retracement.
These are averaged with a quadratic mean, which has the effect of emphasising
large drawdowns, but incorporating all into the result.
</p>
<div class="example">
<pre class="example-preformatted"> / R[1]^2 + R[2]^2 + ... + R[N]^2 \
Ulcer = sqrt | ------------------------------ |
\ N /
</pre></div>
<p>The index can be calculated over the kind of period one might hold an
investment to calculate a measure of the ulcer-producing drawdowns suffered
during that period.
</p>
<hr>
</div>
<div class="section-level-extent" id="Ultimate-Oscillator">
<div class="nav-panel">
<p>
Next: <a href="#Vertical-Horizontal-Filter" accesskey="n" rel="next">Vertical Horizontal Filter</a>, Previous: <a href="#Ulcer-Index" accesskey="p" rel="prev">Ulcer Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a...
</div>
<h3 class="section" id="Ultimate-Oscillator-1"><span>10.47 Ultimate Oscillator<a class="copiable-link" href="#Ultimate-Oscillator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Ultimate-oscillator"></a>
<a class="index-entry-id" id="index-Williams_002c-Larry"></a>
<p>The Ultimate Oscillator by Larry Williams is based on buying pressure as a
proportion of true range over recent periods, with the past 7 days, 14
days and 28 days combined together.
</p>
<p>The calculation starts with “buying pressure”, which is the amount by which
the close is above the “true low” on a given day. The true low is the
lesser of the given day’s trading low, and the previous close.
</p>
<div class="example">
<pre class="example-preformatted">bp = close - min (low, prev close)
</pre></div>
<p>The true range (the same as in <a class="ref" href="#True-Range">True Range</a>) is the difference between the
“true high” and the true low above. The true high is the greater of the
given day’s trading high, and the previous close.
</p>
<div class="example">
<pre class="example-preformatted">tr = max (high, prev close) - min (low, prev close)
</pre></div>
<p>The total buying pressure over the past 7 days is expressed as a fraction of
the total true range over that period. If bp1 is today, bp2
yesterday, etc then
</p>
<div class="example">
<pre class="example-preformatted"> bp1 + bp2 + ... + bp7
avg7 = ---------------------
tr1 + tr2 + ... + tr7
</pre></div>
<p>The same is done for the past 14 days and past 28 days and the resulting three
values combined in proportions 4:2:1, and expressed as a percentage.
</p>
<div class="example">
<pre class="example-preformatted"> 4 * avg7 + 2 * avg14 + avg28
UltOsc = 100 * ----------------------------
4 + 2 + 1
</pre></div>
<p>The oscillator ranges from 0 to 100 and is interpreted in similar ways to
other oscillators, with extremes indicating overbought or oversold conditions,
and bullish or bearish divergence when new lows or highs fail to be made.
Williams recommended levels of 70 and 30 for overbought or oversold and those
are drawn by Chart.
</p>
<hr>
</div>
<div class="section-level-extent" id="Vertical-Horizontal-Filter">
<div class="nav-panel">
<p>
Next: <a href="#Volatility-Ratio" accesskey="n" rel="next">Volatility Ratio</a>, Previous: <a href="#Ultimate-Oscillator" accesskey="p" rel="prev">Ultimate Oscillator</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a hre...
</div>
<h3 class="section" id="Vertical-Horizontal-Filter-1"><span>10.48 Vertical Horizontal Filter<a class="copiable-link" href="#Vertical-Horizontal-Filter-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Vertical-horizontal-filter"></a>
<a class="index-entry-id" id="index-VHF"></a>
<a class="index-entry-id" id="index-Filter_002c-vertical-horizontal"></a>
<a class="index-entry-id" id="index-White_002c-Adam"></a>
<p>The vertical horizontal filter (VHF) by Adam White expresses the range of
closing prices as a fraction of total close-to-close movement over a given
N-day period.
</p>
<div class="example">
<pre class="example-preformatted"> highest close - lowest close
VHF = -------------------------------------
total of each abs(close - prev close)
</pre></div>
<p>This ratio ranges from 0 to 1. The extreme of 1 means all close-to-close
movement was in one direction, so they added up to the full range. A usual
value is somewhere in the middle, reflecting a mixture of advances and
retreats that occur even in a strong market.
</p>
<hr>
</div>
<div class="section-level-extent" id="Volatility-Ratio">
<div class="nav-panel">
<p>
Next: <a href="#Williams-_0025R" accesskey="n" rel="next">Williams %R</a>, Previous: <a href="#Vertical-Horizontal-Filter" accesskey="p" rel="prev">Vertical Horizontal Filter</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="Volatility-Ratio-1"><span>10.49 Volatility Ratio<a class="copiable-link" href="#Volatility-Ratio-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Volatility-ratio"></a>
<a class="index-entry-id" id="index-Ratio_002c-volatility"></a>
<a class="index-entry-id" id="index-VOLR"></a>
<a class="index-entry-id" id="index-Schwager_002c-Jack"></a>
<p>The volatility ratio by Jack Schwager expresses the latest day’s trading range
as a ratio of the overall range for a past N days. “True range” is used for
both (see <a class="pxref" href="#True-Range">True Range</a>), so gaps are included in the calculation.
</p>
lib/App/Chart/doc/chart.html view on Meta::CPAN
</p>
<ul class="itemize mark-bullet">
<li>%R reaches -100%.
</li><li>Five trading days pass since -100% was last reached
</li><li>%R rises above -95% or -85%.
</li></ul>
<p>or conversely to sell an overbought
</p>
<ul class="itemize mark-bullet">
<li>%R reaches 0%.
</li><li>Five trading days pass since 0% was last reached
</li><li>%R falls below -5% or -15%.
</li></ul>
<hr>
</div>
<div class="section-level-extent" id="Williams-Accumulation_002fDistribution">
<div class="nav-panel">
<p>
Next: <a href="#Zig-Zag-Indicator" accesskey="n" rel="next">Zig Zag Indicator</a>, Previous: <a href="#Williams-_0025R" accesskey="p" rel="prev">Williams %R</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concep...
</div>
<h3 class="section" id="Williams-Accumulation_002fDistribution-1"><span>10.51 Williams Accumulation/Distribution<a class="copiable-link" href="#Williams-Accumulation_002fDistribution-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Williams-accumulation_002fdistribution"></a>
<a class="index-entry-id" id="index-Accumulation_002fdistribution_002c-Williams"></a>
<a class="index-entry-id" id="index-Index_002c-Williams-accumulation_002fdistribution"></a>
<a class="index-entry-id" id="index-Williams_002c-Larry-2"></a>
<p>The Williams Accumulation/Distribution index by Larry Williams forms a running
total of “buying pressure” on up days, or “selling pressure” on down days.
</p>
<div class="example">
<pre class="example-preformatted"> / (close - true low) if close > prev close
WAD = WAD[prev] + | 0 if close = prev close
\ (close - true high) if close > prev close
</pre></div>
<p>Buying pressure is represented by how far the close is above the true low
(which is the lesser of today’s low or yesterday’s close). Selling pressure
is represented by how far the close is below the true high (which is the
greater of today’s high or yesterday’s close). Notice the difference “close
- true high” is negative, so on down days WAD decreases.
</p>
<p>The starting point (ie. the zero point) for the running total is arbitrary.
In Chart it’s merely the segment of data first displayed.
</p>
<hr>
</div>
<div class="section-level-extent" id="Zig-Zag-Indicator">
<div class="nav-panel">
<p>
Previous: <a href="#Williams-Accumulation_002fDistribution" accesskey="p" rel="prev">Williams Accumulation/Distribution</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-Index" title="Index" rel="index">In...
</div>
<h3 class="section" id="Zig-Zag-Indicator-1"><span>10.52 Zig Zag Indicator<a class="copiable-link" href="#Zig-Zag-Indicator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Zig-zag-indicator"></a>
<a class="index-entry-id" id="index-Indicator_002c-zig-zag"></a>
<p>The zig zag indicator is a simple way to ignore retracements less than a given
X percentage.
</p>
<p>When prices are rising, a line is drawn up from the previous low to the latest
high. Pullbacks smaller than the given X% are ignored. The trend is only
considered to have turned down when a point X% below that latest high is
penetrated. Then a down line is drawn, it in turn continuing until a reversal
of more than X% above the last lowe occurs. The result is a kind of zig zag,
ignoring small moves, small according to the X%.
</p>
<p>For the last line segment, at the right of the chart, the line is drawn to the
high (or low) then horizontally to the edge of the screen. The horizontal
part means there hasn’t yet been a retracement of X% from that level shown.
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources-10" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-10">
<h4 class="subsection"><span>10.52.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-10"> ¶</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://stockcharts.com/education/IndicatorAnalysis/indic_ZigZag.html">http://stockcharts.com/education/IndicatorAnalysis/indic_ZigZag.html</a> –
sample chart of ‘<samp class="samp">HPQ</samp>’ from 1999/2000.
</li></ul>
<hr>
</div>
</div>
</div>
<div class="chapter-level-extent" id="Common-Calculations">
<div class="nav-panel">
<p>
Next: <a href="#Other-Indicator-Packages" accesskey="n" rel="next">Other Indicator Packages</a>, Previous: <a href="#Indicators" accesskey="p" rel="prev">Indicators</a>, Up: <a href="#Top" accesskey="u" rel="up">Chart</a> [<a href="#Concept-In...
</div>
<h2 class="chapter" id="Common-Calculations-1"><span>11 Common Calculations<a class="copiable-link" href="#Common-Calculations-1"> ¶</a></span></h2>
<a class="index-entry-id" id="index-Common-calculations"></a>
<p>The following are algorithms and calculations shared among various indicators
and averages.
</p>
<ul class="mini-toc">
<li><a href="#Linear-Regression" accesskey="1">Linear Regression</a></li>
<li><a href="#Standard-Deviation" accesskey="2">Standard Deviation</a></li>
<li><a href="#True-Range" accesskey="3">True Range</a></li>
</ul>
<hr>
<div class="section-level-extent" id="Linear-Regression">
<div class="nav-panel">
<p>
Next: <a href="#Standard-Deviation" accesskey="n" rel="next">Standard Deviation</a>, Previous: <a href="#Common-Calculations" accesskey="p" rel="prev">Common Calculations</a>, Up: <a href="#Common-Calculations" accesskey="u" rel="up">Common Calculati...
</div>
<h3 class="section" id="Linear-Regression-1"><span>11.1 Linear Regression<a class="copiable-link" href="#Linear-Regression-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Linear-regression"></a>
<a class="index-entry-id" id="index-Least-squares_002c-line"></a>
<p>The “least squares” or “linear regression” algorithm produces a best
fitting straight line through the middle of a set of N data points
<em class="math">x1,y1,
..., xN,yN</em>. In Chart this means a set of prices Y, and dates X
(with non-trading days collapsed out).
( run in 1.504 second using v1.01-cache-2.11-cpan-39bf76dae61 )