view release on metacpan or search on metacpan
doc/chart.texi view on Meta::CPAN
To draw a line press and hold mouse @key{Button-2} at the starting point, and
drag to the end. On a two-button mouse @key{Button-2} usually means pressing
both buttons at the same time.
@cindex @key{H}
@cindex @key{Escape}
@cindex @key{D}
While drawing, press @key{H} to toggle between a sloping line (the default)
and a horizontal line. Press the spacebar to swap to move the opposite end of
the line. An existing line can be repositioned by pressing and dragging
@key{Button-2} near an endpoint. Press @key{Escape} to abort an edit. To
delete a line press @key{D} while dragging it.
@section Alert Levels
@cindex Alert levels
@cindex Alert list
@cindex Edit alert levels
Alert levels can be set if you want to know when a stock trades (or has a
bid/offer) above or below some price. Symbols which have gone past an alert
level are put into the Alerts list.
doc/chart.texi view on Meta::CPAN
@myimage{chart-tema-weights, TEMA weights graph}
@c ---------------------------------------------------------------------------
@node Endpoint Moving Average, Fractal Adaptive Moving Average, Double and Triple Exponential Moving Average, Averages
@section Endpoint Moving Average
@cindex Endpoint moving average
@cindex EPMA
@cindex Least squares moving average
@cindex LSQMA
@cindex Average, endpoint
@cindex Average, least squares
@cindex Moving average, endpoint
@cindex Moving average, least squares
@cindex Time series forecast
@cindex TSF
@cindex Sharp, Joe
@cindex Average, modified
@cindex Moving average, modified
@cindex Modified moving average
The endpoint moving average (EPMA) establishes an average price by fitting a
least squares straight line (@pxref{Linear Regression}) 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.
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's ``modified moving average'' is the same thing too.
The formula ends up being a straightforward weighted average of past N prices,
with weights going from @m{2N-1,2*N-1} down to @math{-N+2}. 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 @ms{p,1} is today's
lib/App/Chart.pm view on Meta::CPAN
foreach my $inc (@INC) {
my $filename = File::Spec->catfile ($inc, 'App', 'Chart', @_);
if (-e $filename) { return $filename; }
}
require File::Basename;
return File::Spec->catfile (File::Basename::dirname($INC{'App/Chart.pm'}),
'Chart', @_);
}
# return true if range ($alo,$ahi) overlaps range ($blo,$bhi)
# each endpoint is taken as inclusive, so say (1,4) and (4,7) do overlap
#
sub overlap_inclusive_p {
my ($alo, $ahi, $blo, $bhi) = @_;
return ! ($ahi < $blo || $alo > $bhi);
}
1;
__END__
=head1 NAME
lib/App/Chart/Gtk2/Ex/LineClipper.pm view on Meta::CPAN
circular if the pixels aren't square, well, yes, but the same is true of the
line drawing. The single width used vertically and horizontally for the
line segments makes them appear wider or narrower according to their angle.
=item C<< $linedrawer->add ($gc, $x, $y) >>
Add a point to C<$linedrawer>. The points accumulated will have connected line
segments drawn from each to the next, in the order they're added.
C<$gc> is a C<Gtk2::Gdk::GC> for the new segment, ie. from the current
endpoint to the new C<$x>,C<$y>. Different GCs can be used for different
segments and the LineClipper takes care of passing runs of the same GC to
C<clipped_draw_lines>.
=item C<< $linedrawer->end() >>
Draw the line segments accumulated, if any, and set C<$linedrawer> back to
empty, ready to start a new completely separate sequence of points.
You can use this to force a gap between points, ie. draw everything
accumulated so far and make subsequent points a new run.
lib/App/Chart/Series/Derived/Adjust.pm view on Meta::CPAN
sub Alerts_arrayref {
my ($self) = @_;
my $parent = $self->{'parent'};
if (my $func = $parent->can('Alerts_arrayref')) {
return $parent->$func;
} else {
return [];
}
}
# FIXME: Adjust endpoints per display
sub AnnLines_arrayref {
my ($self) = @_;
my $parent = $self->{'parent'};
if (my $func = $parent->can('AnnLines_arrayref')) {
return $parent->$func;
} else {
return [];
}
}
lib/App/Chart/Series/Derived/EPMA.pm view on Meta::CPAN
use Locale::TextDomain ('App-Chart');
use base 'App::Chart::Series::Indicator';
use App::Chart::Series::Calculation;
use App::Chart::Series::Derived::SMA;
# As EPMA:
#
# http://www.linnsoft.com/tour/techind/movAvg.htm
# Formulas LSMA as endpoint, and EPMA as weightings "3*i-n-1".
# Sample Nasdaq 100 (symbol QQQ, yahoo now ^IXIC) from 2001 of both
# (they come out the same).
#
# http://www.traders.com/Documentation/FEEDbk_docs/Archive/062001/Letters/Letters.html
# TASC letters June 2001, Don Kraska on the equivalence of his "3j-m-1"
# (j=1 to j=m where price[m] latest), with what John Bellantoni
# described in April 2001 letters.
#
# http://www.traders.com/Documentation/FEEDbk_docs/Archive/0198/Abstracts_new/TILLSON/Tillson9801.html
# Excerpt from TASC January 1998. Sample chart of EPMA (and IE/2) on
lib/App/Chart/Series/Derived/EPMA.pm view on Meta::CPAN
my ($y) = @_;
return ($linreg_proc->($y))[0];
};
}
1;
__END__
# =head1 NAME
#
# App::Chart::Series::Derived::EPMA -- endpoint moving average
#
# =head1 SYNOPSIS
#
# my $series = $parent->EPMA($N);
#
# =head1 DESCRIPTION
#
# ...
#
# =head1 SEE ALSO
lib/App/Chart/doc/chart.html view on Meta::CPAN
<p>To draw a line press and hold mouse <kbd class="key">Button-2</kbd> at the starting point, and
drag to the end. On a two-button mouse <kbd class="key">Button-2</kbd> usually means pressing
both buttons at the same time.
</p>
<a class="index-entry-id" id="index-H"></a>
<a class="index-entry-id" id="index-Escape"></a>
<a class="index-entry-id" id="index-D"></a>
<p>While drawing, press <kbd class="key">H</kbd> to toggle between a sloping line (the default)
and a horizontal line. Press the spacebar to swap to move the opposite end of
the line. An existing line can be repositioned by pressing and dragging
<kbd class="key">Button-2</kbd> near an endpoint. Press <kbd class="key">Escape</kbd> to abort an edit. To
delete a line press <kbd class="key">D</kbd> while dragging it.
</p>
</div>
<div class="section-level-extent" id="Alert-Levels">
<h3 class="section"><span>7.3 Alert Levels<a class="copiable-link" href="#Alert-Levels"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Alert-levels"></a>
<a class="index-entry-id" id="index-Alert-list"></a>
<a class="index-entry-id" id="index-Edit-alert-levels"></a>
<p>Alert levels can be set if you want to know when a stock trades (or has a
lib/App/Chart/doc/chart.html view on Meta::CPAN
<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"> ¶</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’s “modified moving average” 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’s
lib/App/Chart/doc/chart.html view on Meta::CPAN
<tr><td></td><td class="printindex-index-entry"><a href="#index-Austria">Austria</a></td><td class="printindex-index-section"><a href="#Yahoo-Exchanges">Yahoo Exchanges</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Autoload-chartprog_002eel">Autoload <samp class="file">chartprog.el</samp></a></td><td class="printindex-index-section"><a href="#Emacs">Emacs</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Automation_002c-download">Automation, download</a></td><td class="printindex-index-section"><a href="#Download">Download</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average">Average</a></td><td class="printindex-index-section"><a href="#View-Style">View Style</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average-1">Average</a></td><td class="printindex-index-section"><a href="#Bollinger-Bands">Bollinger Bands</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average-2">Average</a></td><td class="printindex-index-section"><a href="#Kirshenbaum-Bands">Kirshenbaum Bands</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average-directional-index">Average directional index</a></td><td class="printindex-index-section"><a href="#Directional-Movement-Index">Directional Movement Index</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average-true-range">Average true range</a></td><td class="printindex-index-section"><a href="#Average-True-Range">Average True Range</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-double-exponential">Average, double exponential</a></td><td class="printindex-index-section"><a href="#Double-and-Triple-Exponential-Moving-Average">Double and Triple Expone...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-double-exponential-1">Average, double exponential</a></td><td class="printindex-index-section"><a href="#MASS-Index">MASS Index</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-endpoint">Average, endpoint</a></td><td class="printindex-index-section"><a href="#Endpoint-Moving-Average">Endpoint Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-exponential">Average, exponential</a></td><td class="printindex-index-section"><a href="#Exponential-Moving-Average">Exponential Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-fractal-adaptive">Average, fractal adaptive</a></td><td class="printindex-index-section"><a href="#Fractal-Adaptive-Moving-Average">Fractal Adaptive Moving Average</a></td><...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-Guppy-multiple">Average, Guppy multiple</a></td><td class="printindex-index-section"><a href="#Guppy-Multiple-Moving-Average">Guppy Multiple Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-Kaufman-adaptive">Average, Kaufman adaptive</a></td><td class="printindex-index-section"><a href="#Kaufman-Adaptive-Moving-Average">Kaufman Adaptive Moving Average</a></td><...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-least-squares">Average, least squares</a></td><td class="printindex-index-section"><a href="#Endpoint-Moving-Average">Endpoint Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-modified">Average, modified</a></td><td class="printindex-index-section"><a href="#Endpoint-Moving-Average">Endpoint Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-regularized-exponential">Average, regularized exponential</a></td><td class="printindex-index-section"><a href="#Regularized-Exponential-Moving-Average">Regularized Exponent...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-simple">Average, simple</a></td><td class="printindex-index-section"><a href="#Simple-Moving-Average">Simple Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-sine-weighted">Average, sine weighted</a></td><td class="printindex-index-section"><a href="#Sine-Weighted-Moving-Average">Sine Weighted Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Average_002c-triangular">Average, triangular</a></td><td class="printindex-index-section"><a href="#Triangular-Moving-Average">Triangular Moving Average</a></td></tr>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<tr><td></td><td class="printindex-index-entry"><a href="#index-Money-Flow-Index">Money Flow Index</a></td><td class="printindex-index-section"><a href="#Money-Flow-Index">Money Flow Index</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Money-flow_002c-Chaikin">Money flow, Chaikin</a></td><td class="printindex-index-section"><a href="#Chaikin-Money-Flow">Chaikin Money Flow</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Money-flow_002c-Twiggs">Money flow, Twiggs</a></td><td class="printindex-index-section"><a href="#Twiggs-Money-Flow">Twiggs Money Flow</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Monthly">Monthly</a></td><td class="printindex-index-section"><a href="#Main-Window">Main Window</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Movement_002c-Ease-of">Movement, Ease of</a></td><td class="printindex-index-section"><a href="#Ease-of-Movement">Ease of Movement</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average">Moving average</a></td><td class="printindex-index-section"><a href="#Bollinger-Bands">Bollinger Bands</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average-1">Moving average</a></td><td class="printindex-index-section"><a href="#Kirshenbaum-Bands">Kirshenbaum Bands</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average-convergence_002fdivergence">Moving average convergence/divergence</a></td><td class="printindex-index-section"><a href="#MACD">MACD</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-double-exponential">Moving average, double exponential</a></td><td class="printindex-index-section"><a href="#Double-and-Triple-Exponential-Moving-Average">Double and...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-double-exponential-1">Moving average, double exponential</a></td><td class="printindex-index-section"><a href="#MASS-Index">MASS Index</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-endpoint">Moving average, endpoint</a></td><td class="printindex-index-section"><a href="#Endpoint-Moving-Average">Endpoint Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-exponential">Moving average, exponential</a></td><td class="printindex-index-section"><a href="#Exponential-Moving-Average">Exponential Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-fractal-adaptive">Moving average, fractal adaptive</a></td><td class="printindex-index-section"><a href="#Fractal-Adaptive-Moving-Average">Fractal Adaptive Moving Ave...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-Guppy-multiple">Moving average, Guppy multiple</a></td><td class="printindex-index-section"><a href="#Guppy-Multiple-Moving-Average">Guppy Multiple Moving Average</a>...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-Kaufman-adaptive">Moving average, Kaufman adaptive</a></td><td class="printindex-index-section"><a href="#Kaufman-Adaptive-Moving-Average">Kaufman Adaptive Moving Ave...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-least-squares">Moving average, least squares</a></td><td class="printindex-index-section"><a href="#Endpoint-Moving-Average">Endpoint Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-modified">Moving average, modified</a></td><td class="printindex-index-section"><a href="#Endpoint-Moving-Average">Endpoint Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-regularized-exponential">Moving average, regularized exponential</a></td><td class="printindex-index-section"><a href="#Regularized-Exponential-Moving-Average">Regula...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-simple">Moving average, simple</a></td><td class="printindex-index-section"><a href="#Simple-Moving-Average">Simple Moving Average</a></td></tr>
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-sine-weighted">Moving average, sine weighted</a></td><td class="printindex-index-section"><a href="#Sine-Weighted-Moving-Average">Sine Weighted Moving Average</a></td...
<tr><td></td><td class="printindex-index-entry"><a href="#index-Moving-average_002c-triangular">Moving average, triangular</a></td><td class="printindex-index-section"><a href="#Triangular-Moving-Average">Triangular Moving Average</a></td></tr>