App-Chart

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

inc/MyMakeMakerGettext.pm
lib/App/Chart.pm
lib/App/Chart/Annotation.pm
lib/App/Chart/Barchart.pm
lib/App/Chart/chart.bash
lib/App/Chart/chart.desktop
lib/App/Chart/chart.xpm
lib/App/Chart/Database.pm
lib/App/Chart/Database/Create.pm
lib/App/Chart/DBI.pm
lib/App/Chart/doc/chart-dema-3-weights.png
lib/App/Chart/doc/chart-dema-weights.png
lib/App/Chart/doc/chart-ema-2-weights.png
lib/App/Chart/doc/chart-ema-3-weights.png
lib/App/Chart/doc/chart-ema-weights.png
lib/App/Chart/doc/chart-epma-weights.png
lib/App/Chart/doc/chart-hull-weights.png
lib/App/Chart/doc/chart-laguerre-weights.png
lib/App/Chart/doc/chart-rema-weights.png
lib/App/Chart/doc/chart-sine-weights.png
lib/App/Chart/doc/chart-t3-weights.png
lib/App/Chart/doc/chart-tema-weights.png
lib/App/Chart/doc/chart-tma-weights.png
lib/App/Chart/doc/chart-wma-weights.png
lib/App/Chart/doc/chart-zlema-weights.png
lib/App/Chart/doc/chart.html
lib/App/Chart/Download.pm
lib/App/Chart/DownloadCost.pm
lib/App/Chart/DownloadHandler.pm
lib/App/Chart/DownloadHandler/DividendsPage.pm
lib/App/Chart/DownloadHandler/IndivChunks.pm
lib/App/Chart/DownloadHandler/IndivInfo.pm
lib/App/Chart/EmacsMain.pm
lib/App/Chart/Finance/Yahoo/Exchanges.pm
lib/App/Chart/FinanceQuote.pm

MANIFEST.SKIP  view on Meta::CPAN

# built stuff
^Makefile$
^blib
^pm_to_blib
^TAGS$
^doc/chart\.info.*
^doc/[^/]+\.dvi
^doc/[^/]+\.html
^doc/[^/]+\.eps
^doc/[^/]+\.pdf
^doc/[^/]+\.png
^doc/[^/]+\.ps
^doc/[^/]+\.txt
^doc/html-split

# built - texinfo temporaries
\.(aux|cp|cps|fn|fns|ky|log|pg|toc|tp|tps|vr)$

# built - cdbs and debhelper
^debian/stamp-
^debian/.*\.log$

Makefile.PL  view on Meta::CPAN

# eg. /usr/share/applications, for .desktop files
# APPLICATIONSDIR = $(PREFIX)/share/applications
# doc_install :: chart.desktop
# 	install -d $(DESTDIR)$(APPLICATIONSDIR)
# 	install chart.desktop $(DESTDIR)$(APPLICATIONSDIR)


#------------------------------------------------------------------------------
# doc stuff
#
# doc/*.txt and doc/*.png are left in that directory so
# "M-x makeinfo-buffer" can be used during development.  They're excluded
# from the dist by MANIFEST.SKIP.  The *.png are copied to lib/App/Chart/doc
# for the dist.

# Depend only on the generator program doc/weights.pl since the .txt and
# .png are not in the doc directory of the dist.
HTML_TEXI_DEPS = \
  doc/chart.texi doc/version.texi doc/weights.pl

doc: lib/App/Chart/doc/chart.html doc/chart.omf

lib/App/Chart/doc/chart.html: $(HTML_TEXI_DEPS) doc/mung-html.pl
	make doc/chart-ema-weights.txt doc/chart-ema-weights.png # which builds others too
	cd doc && makeinfo --html --no-split chart.texi
	mkdir -p lib/App/Chart/doc
	mv doc/chart.html lib/App/Chart/doc/chart.html
	cp doc/*.png lib/App/Chart/doc
	cd lib/App/Chart/doc && $(PERL) ../../../../doc/mung-html.pl chart.html

doc/version.texi doc/chart.omf: doc/chart.texi
	echo '@c  Generated by top-level Makefile, DO NOT EDIT' >doc/version.texi
	echo '@set VERSION $(VERSION)' >>doc/version.texi
	echo '@set EDITION $(VERSION)' >>doc/version.texi
	echo '@set UPDATED '`date '+%d %B %Y'` >>doc/version.texi
	echo '@set UPDATED_MONTH '`date '+%B %Y'` >>doc/version.texi
	cd doc && perl -pi \
	  -e 's{version identifier="[^"]*"}{version identifier="$(VERSION)"};' \
	  -e 's{date="[^"]*"}{date="'`date +%Y-%m-%d`'"};' \
	  -e 's{<date>[^<]*</date>}{<date>'`date +%Y-%m-%d`'</date>};' \
	  chart.omf

info: doc/chart.info
doc/chart.info: doc/chart.texi doc/version.texi doc/chart-ema-weights.txt doc/chart-ema-weights.png
	cd doc && makeinfo chart.texi

TEXI2DVI = texi2dvi
dvi: doc/chart.dvi
doc/chart.dvi: doc/chart.texi doc/version.texi doc/chart-ema-weights.eps
	cd doc && $(TEXI2DVI) chart.texi

DVIPS = dvips
ps: doc/chart.ps
doc/chart.ps: doc/chart.dvi

Makefile.PL  view on Meta::CPAN

  lib/App/Chart/Series/Derived/LaguerreFilter.pm \
  lib/App/Chart/Series/Derived/SMA.pm \
  lib/App/Chart/Series/Derived/REMA.pm \
  lib/App/Chart/Series/Derived/SineMA.pm \
  lib/App/Chart/Series/Derived/T3.pm \
  lib/App/Chart/Series/Derived/TMA.pm \
  lib/App/Chart/Series/Derived/TEMA.pm \
  lib/App/Chart/Series/Derived/WMA.pm \
  lib/App/Chart/Series/Derived/ZLEMA.pm

doc/chart-ema-weights.txt doc/chart-ema-weights.png: $(WEIGHTS_SOURCES)
	cd doc && $(PERL) -I ../lib weights.pl

doc/chart-ema-weights.eps: $(WEIGHTS_SOURCES)
	cd doc && $(PERL) -I ../lib weights.pl --eps
# "epstopdf" is from tetex or texlive
#   (debian package texlive-font-utils or previously texlive-extra-utils).
# "ps2pdf" is from ghostscript.
EPSTOPDF = epstopdf
PS2PDF = ps2pdf
doc/chart-ema-weights.pdf: doc/chart-ema-weights.eps

Makefile.PL  view on Meta::CPAN

	#
	cd doc; for i in chart-*-weights.eps; do \
	  $(EPSTOPDF) $$i || $(PS2PDF) $$i || exit 1; \
	done


html-split: doc/html-split/index.html
doc/html-split/index.html: $(HTML_TEXI_DEPS) doc/mung-html.pl
	rm -rf doc/html-split
	cd doc && makeinfo --html -o html-split chart.texi
	cp doc/*.png doc/html-split
	cd doc/html-split && $(PERL) ../mung-html.pl *.html

HERE
  return $ret;
}

#------------------------------------------------------------------------------
#
# cf
# Hurst.pdf

SIGNATURE  view on Meta::CPAN

SHA256 6524043c1516dd1f1fc5f8ec5538e36fb962d4e5e2ec159402d5587f8c6f103d lib/App/Chart/Timebase/Weeks.pm
SHA256 c315cb4dfbf85ec683ae71a64613f0fe4de73d0aae10f6142e3619cfdb803587 lib/App/Chart/Timebase/Years.pm
SHA256 68228c52ddf2be02c27ff5670c834a3aadad4c6f1723f837dbdfae54316e5aa8 lib/App/Chart/UserAgent.pm
SHA256 e577b6c2f81f22d43c922ede410157e66b4bee099c6405b35e05307004312a73 lib/App/Chart/Vacuum.pm
SHA256 aca36821283d43343cff418c5095dbc3b1eef00dca3d2c2564bf42d1cd5dad60 lib/App/Chart/Weblink.pm
SHA256 e6c15e64fad11aad88d30513d760c710467ef51388af60c1c1d6fedcbdb62f65 lib/App/Chart/Weblink/SandP.pm
SHA256 1ed76f966b50a15f496f1511d447d3a0c9d1bab81a05e2529c41717bd4832ce1 lib/App/Chart/Yahoo.pm
SHA256 c4f3d088dcb50077ae9870fa5bdaa848fe8815b4d7796359df6a008e4ab5d26a lib/App/Chart/chart.bash
SHA256 2588648a609334978bc5b9f4d299a81986d7b09c8430bb335a1ef5007d3773f9 lib/App/Chart/chart.desktop
SHA256 a8610b0977227aa29ee63ce5d90b5c4d9ababfaab8253aa6e7148b63d3d8841c lib/App/Chart/chart.xpm
SHA256 72c07d23d2d911d81cdd01a255835ae75e81cd868b64eb3d5bdb94f95a43084c lib/App/Chart/doc/chart-dema-3-weights.png
SHA256 1fc664e0ddc1c85770c832b50dc64b9d3265e15daf56971bb2e2345778846ca8 lib/App/Chart/doc/chart-dema-weights.png
SHA256 849331d1976e10fa135ad7334dc26a71da5c6b7bb31bb63eaa044fde9e44c514 lib/App/Chart/doc/chart-ema-2-weights.png
SHA256 ba690e3816c2b41e174b4d13489bf5d68bf10d6f9c8b64bda587b6567b7f6ae1 lib/App/Chart/doc/chart-ema-3-weights.png
SHA256 400d41056dd489cd7c95ec88f2accb85af7a07f55282ce11157b2eb36ee15ef5 lib/App/Chart/doc/chart-ema-weights.png
SHA256 65e5ce4e12e58398acdb27e66a6367e8a10a2d274dc08056c154a8ec0230f1b9 lib/App/Chart/doc/chart-epma-weights.png
SHA256 c9d2331e2dbe26183572915333631f39ec5bf32810f5faf7cbd2cfed03b79f1a lib/App/Chart/doc/chart-hull-weights.png
SHA256 6ee41671c5de493bac5f9325ac955e992a1c8be32ea6d052b16c162dba8140a7 lib/App/Chart/doc/chart-laguerre-weights.png
SHA256 e064a31178e49feaa19acf133644e74f3a5ddaf23f543c97029b81421ff123fc lib/App/Chart/doc/chart-rema-weights.png
SHA256 cee708f76bbbcc438f33ff20455f966a07e55a10b62137e2b7c4f1076517441d lib/App/Chart/doc/chart-sine-weights.png
SHA256 c931417b2551f070e5cb635606e38c7afcb6ca93cd8ee0874953c630b08d6322 lib/App/Chart/doc/chart-t3-weights.png
SHA256 52dd8028bbb98b1d7f2de7cbc1ce697d57996c0a3eec3d689e8d7e307d148cee lib/App/Chart/doc/chart-tema-weights.png
SHA256 ea029774ac01f077b18225f4e1548f5361e18a1d8d54836ad1cdbc948c7e0686 lib/App/Chart/doc/chart-tma-weights.png
SHA256 0b17e1c364d3c82d10e6a1dd1ffb9d1baa0d0bb6aff68919256a7bb992690d48 lib/App/Chart/doc/chart-wma-weights.png
SHA256 f3eb4752a60c1f0a4f30994b69f9c3fe840d0975ab207c7eb72b9fe4d551d697 lib/App/Chart/doc/chart-zlema-weights.png
SHA256 c988a480effd69f922fd9e21419f3701b3fc7d01499e7ea4674445847727889e lib/App/Chart/doc/chart.html
SHA256 c53b44b3b294bc25281f1bb18c495c1b4920c530a83ded3b40b5b1ce88766c96 lib/Finance/Quote/Chart.pm
SHA256 52fa1d18f2192e756c2cd159cbce44e10a1748d496ae29d5a54dd7e456d36330 lib/GT/DB/Chart.pm
SHA256 81b49242936bd334c753e104edaf47584a72e11f182f2b583b44b8d463188def lib/LocaleData/de/LC_MESSAGES/App-Chart.mo
SHA256 e627d2f8e1ab0af60a41277507519776afde874de904c47f95f7a6cb367707c3 lib/LocaleData/en_US/LC_MESSAGES/App-Chart.mo
SHA256 f94c151c321d275dc2c3a87464f69e5ffb334bb83ef7554a431ed3f926ec519e lib/LocaleData/fr/LC_MESSAGES/App-Chart.mo
SHA256 211524ecb41d293bf8dac010ee02a4d4646497c8c84c4a9e7365806a4118ad21 lib/LocaleData/la/LC_MESSAGES/App-Chart.mo
SHA256 23a4d11956bc60de9543eb5ce00d2900e48ae2afa13e2a395fe3d5cb1b1c2db5 maybe/BrowseHistoryDialog.pm
SHA256 2eef1e93a1f7c854b6ae623c159a95f6691da6cffe358154b0d968c372f2c662 maybe/Build-PL
SHA256 e074c895a39391b85856350347e6822355de6e6023f4070854fffe50b6b4a902 maybe/IdleObject.pm

debian/doc-base  view on Meta::CPAN

Abstract: This manual describes how to install and use Chart
 stock and commodity charting.
Section: Office

Format: HTML
Index: /usr/share/perl5/App/Chart/doc/chart.html
Files: /usr/share/perl5/App/Chart/doc/chart.html

Format: Info
Index: /usr/share/info/chart.info.gz
Files: /usr/share/info/chart.info*.gz /usr/share/info/chart-*.png

debian/rules  view on Meta::CPAN

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/perl-makemaker.mk

# instead of makemaker default "chart.1p"
DEB_MAKEMAKER_USER_FLAGS = MAN1EXT=1

# chart.info, not installed by Makefile.PL yet
DEB_INSTALL_INFO_chart = doc/chart.info*
build/chart::
	$(MAKE) info
# png files for info not known to dh_installinfo
install/chart::
	mkdir -p debian/chart/usr/share/info
	cd debian/chart/usr/share/info && ln -s ../perl5/App/Chart/doc/*.png .
# debhelper 7.4.13 does this automatically, when ready to depend on that
# DEB_COMPRESS_EXCLUDE = .png

# chart.bash completion moved to /usr/share/bash-completion/completions and
# linked back
install/chart::
	mkdir -p debian/chart/usr/share/bash-completion/completions
	mv debian/chart/usr/share/perl5/App/Chart/chart.bash \
	   debian/chart/usr/share/bash-completion/completions/chart
DEB_DH_LINK_chart += usr/share/bash-completion/completions/chart \
	             usr/share/perl5/App/Chart/chart.bash

doc/chart.texi  view on Meta::CPAN

+/-
@end macro
@end ifnottex

@c  @myimage{filename,alt}
@c
@c  Leave out the "alt" in info mode, since there's an ascii art rendition
@c  from the txt file, which should be enough for a viewer that doesn't
@c  recognise [image].
@c
@c  And leave out "png" from info mode because although it ought to do no
@c  harm, a malloc problem in makeinfo 4.8 is tickled.  (It goes one char over
@c  the malloced size, which means certain sized filenames are affected, and
@c  depending if libc puts any padding.)
@c
@ifinfo
@macro myimage {F,A}
@quotation
@image{\F\}
@end quotation

@end macro
@end ifinfo
@c
@ifnotinfo
@macro myimage {F,A}
@*
@center @image{\F\, 14cm, 7.5cm, \A\, png}
@end macro
@end ifnotinfo


@finalout
@headings double
@setchapternewpage on
@paragraphindent 0

@c  html <meta name=description content="...">

doc/mung-html.pl  view on Meta::CPAN

  #

  if ($option_verbose) {
    print "  unchanged\n";
  }
  return $url;
}


#------------------------------------------------------------------------------
# png sizes

my $image_count = 0;

sub mung_img_sizes {
  my ($body) = @_;
  $body =~ s{<img (src="([^"]+)")}{
    my $filename = $2;
    $image_count++;
    my $info = Image::ExifTool::ImageInfo($filename);
    if (my $error = $info->{'Error'}) {

doc/weights.pl  view on Meta::CPAN

use strict;
use warnings;
use Carp;
use Data::Dumper;
use Getopt::Long;
use List::Util qw(min max);
use POSIX qw(floor ceil);

my $option_verbose = 0;
my $option_txt = 1;
my $option_png = 1;
my $option_eps = 0;


GetOptions ('eps' => sub {
              $option_eps = 1;
              $option_png = 0;
              $option_txt = 0;
            })
  or exit 1;


#-----------------------------------------------------------------------------
# misc

sub write_file {
  my ($filename, $content) = @_;

doc/weights.pl  view on Meta::CPAN


  $data_max     += $data_range * 0.1;
  $data_min     -= $data_range * 0.1;
  $data_range = $data_max - $data_min;

  while (@$data && $data->[-1] == 0) {
    pop @$data;
  }
  write_file ($datafilename, join ('', map {; "$_\n"} @$data));

  # png
  #
  if ($option_png) {
    # something evil happens with "xtics axis", need dummy xlabel
    write_file ($plotfilename, <<"HERE");
set terminal png size 400,250

# there was some sort of incompatible change in gnuplot 4.2 forcing the
# ``offset'' keyword here, dunno if it works with older gnuplot too ...
set xlabel " " offset 0, -2
set xrange [-0.5:$xhigh]
set xtics axis 5
set mxtics 5

set yrange [$data_min:$data_max]
set format y "%.1f"

unset key
set style fill solid 1.0
set boxwidth 0.6 relative
plot "$datafilename" with boxes lc "red"
HERE

    system("gnuplot $plotfilename 2>&1 >$basename.png") == 0 or die;
  }

  # eps
  #
  if ($option_eps) {
    # something evil happens with "xtics axis", need dummy xlabel
    write_file ($plotfilename, <<"HERE");
set terminal postscript portrait

set xlabel " " offset 0, -2

doc/weights.pl  view on Meta::CPAN

HERE

    system ("gnuplot $plotfilename 2>&1 >$basename.eps") == 0 or die;
  }

  unlink ($datafilename) or die;
  unlink ($plotfilename) or die;
}


sub mung_png {
  my ($filename, $title) = @_;
  require Image::ExifTool;

  # allow writing of extra png "Homepage" field, if not already setup
  { no warnings 'once';
    $Image::ExifTool::UserDefined
      {'Image::ExifTool::PNG::TextualData'}
        {'Homepage'} ||= {};
  }

  my $exif = Image::ExifTool->new;
  $exif->ExtractInfo($filename) or die;

  $exif->SetNewValue ('Title', $title);

doc/weights.pl  view on Meta::CPAN

  }

  if (abs($weights[-1]) >= 1) {
    print "$basename: last weight $weights[-1]\n";
#    exit 1;
  }

  if ($option_txt) {
    text_plot ($basename, \@weights);
  }
  if ($option_png || $option_eps) {
    gnuplot_run ($basename, \@weights);
  }
  if ($option_png) {
    my $params = ($opt{'N'} ? "N=$opt{'N'}" : join(',', @$parameters));
    mung_png ("$basename.png", "$description, $params")
  }
}


#------------------------------------------------------------------------------

# weights (description => "MACD weights",
#          basename    => "chart-macd-weights",
#          method      => 'MACD',
#          parameters  => [12,26],

inc/MyMakeMakerExtras.pm  view on Meta::CPAN

  $post .= "\t-\$(PERLRUNINST) -e 'use "."Test::Vars; all_vars_ok()'\n";

  # ------ pc: podcoverage ------
  foreach (@{$my_options{'MyMakeMakerExtras_Pod_Coverage'}}) {
    my $class = $_;
    # the "." obscures it from MyExtractUse.pm
    $post .= "\t-\$(PERLRUNINST) -e 'use "."Pod::Coverage package=>$class'\n";
  }
  # ------ pc: podlinkcheck ------
  $post .= <<'HERE';
	-podlinkcheck -I lib `ls $(LINT_FILES) | grep -v '\.bash$$|\.desktop$$\.png$$|\.xpm$$'`
HERE
  # ------ pc: podchecker ------
  # "podchecker -warnings -warnings" too much reporting every < and >
  $post .= <<'HERE';
	-podchecker `ls $(LINT_FILES) | grep -v '\.bash$$|\.desktop$$\.png$$|\.xpm$$'`
	perlcritic $(LINT_FILES)
HERE

  # ------ check-copyright-years ------
  $post .= <<'HERE';

HERE

  $post .= "\n";
  $post .= ("MY_EXTRA_FILE_PART_OF = " 

lib/App/Chart/Barchart.pm  view on Meta::CPAN

  my ($resp, $symbol) = @_;
  my $content = $resp->decoded_content (raise_error => 1);

  require HTML::LinkExtor;
  my $parser = HTML::LinkExtor->new(undef, $resp->base);
  $parser->parse($content);
  $parser->eof;

  # eg. 

  # </map><img src="/cache/bde71ebe23ddac66f2d25081b1b5f953.png"
  # must match some of the link target name since there's other images in
  # the page
  foreach my $link ($parser->links) {
    my ($tag, %attr) = @$link;
    $tag eq 'img' or next;
    my $url = $attr{'src'};
    index ($url, '/cache/') >= 0 or next;
    ### $url
    return URI->new_abs($url,$resp->base)->as_string;
  }

lib/App/Chart/Gtk2/IntradayDialog.pm  view on Meta::CPAN

  if (defined $timestamp) {
    my $timet = App::Chart::Download::timestamp_to_timet($timestamp);
    my $timezone = App::Chart::TZ->for_symbol ($symbol);
    $str .= '    ' . POSIX::strftime ($App::Chart::option{'d_fmt'} . ' %H:%M',
                                      $timezone->localtime($timet));
  }
  $str .= "\n\n"; # blank line

  my $pixbuf = $self->{'image'}->_load_pixbuf;
  # $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file
  #   ('/usr/share/emacs/23.2/etc/images/splash.png');
  # $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file
  #   ('/usr/share/games/gav/themes/classic/background_big.png');
  if (! ref $pixbuf) {
    $str .= $pixbuf;  # error message
  }

  my $pwidth = $pcontext->get_width;
  ### $pwidth

  my $layout = $pcontext->create_pango_layout;
  $layout->set_width ($pwidth * Gtk2::Pango::PANGO_SCALE);
  $layout->set_text ($str);

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

EMA = -------------------------------------
       1 +   f  +    f^2   +    f^3   + ...
</pre></div>

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

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

WMA = --------------------------------------------------------
        N    +    N-1     +     N-2    + ... +    2       + 1
</pre></div>

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

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

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

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

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

<hr>
</div>
<div class="section-level-extent" id="Endpoint-Moving-Average">
<div class="nav-panel">
<p>
Next: <a href="#Fractal-Adaptive-Moving-Average" accesskey="n" rel="next">Fractal Adaptive Moving Average</a>, Previous: <a href="#Double-and-Triple-Exponential-Moving-Average" accesskey="p" rel="prev">Double and Triple Exponential Moving Average</a>...
</div>
<h3 class="section" id="Endpoint-Moving-Average-1"><span>8.5 Endpoint Moving Average<a class="copiable-link" href="#Endpoint-Moving-Average-1"> &para;</a></span></h3>

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

<div class="example">
<pre class="example-preformatted">       (2*N-1)*p[1] + (2*N-4)*p[2] + ... + (-N+2)*p[N]
EPMA = -----------------------------------------------
        2*N-1       +  2*N-4       + ... +  -N+2
</pre></div>

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

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

<pre class="example-preformatted">HMA = WMA[floor(sqrt(N))] of (2 * WMA[floor(N/2)] - WMA[N])
</pre></div>

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

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

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

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

<p>The adaptive laguerre filter is a variation on the laguerre filter using a
variable alpha factor which is based on how well the filter is tracking a
past N days prices.  The effect is to follow sustained moves quite closely,
but to change little when prices chop back and forwards in a range.

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

<p>If <em class="math">lambda</em> is zero then REMA is the same as a plain EMA.
Satchwell suggests fairly small values for <em class="math">lambda</em>, and the default
in Chart is 0.5.  John Ehlers noted that if <em class="math">lambda</em> is large REMA
becomes unstable.
</p>
<p>In any case the result of the calculation is still an average of past prices
with a certain set of weights that progressively decrease for older data.  The
following is the weights for <em class="math">N=15</em> and <em class="math">lambda=0.5</em>,
</p>
<br>
<div class="center"><img class="image" src="chart-rema-weights.png" alt="Regularized EMA weights graph">
</div>
<ul class="mini-toc">
<li><a href="#REMA-Momentum-1" accesskey="1">REMA Momentum</a></li>
<li><a href="#Additional-Resources-3" accesskey="2">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="REMA-Momentum-1">
<h4 class="subsection"><span>8.14.1 REMA Momentum<a class="copiable-link" href="#REMA-Momentum-1"> &para;</a></span></h4>
<a class="anchor" id="REMA-Momentum"></a><a class="index-entry-id" id="index-REMA-Momentum"></a>
<a class="index-entry-id" id="index-Regularized-Momentum"></a>

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

<pre class="example-preformatted">     /  1      \         /  2      \             /  N      \
sin |  --- * pi |,  sin |  --- * pi |, ..., sin |  --- * pi |
     \ N+1     /         \ N+1     /             \ N+1     /
</pre></div>

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

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

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

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

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

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

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

<a class="index-entry-id" id="index-TMA"></a>
<a class="index-entry-id" id="index-Average_002c-triangular"></a>
<a class="index-entry-id" id="index-Moving-average_002c-triangular"></a>

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

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

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

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

<hr>
</div>

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

<div class="section-level-extent" id="EMA-of-EMA-1">
<h3 class="section"><span>10.23 EMA of EMA<a class="copiable-link" href="#EMA-of-EMA-1"> &para;</a></span></h3>

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

<hr>
</div>
<div class="section-level-extent" id="Momentum-and-Rate-of-Change">
<div class="nav-panel">

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

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

<hr>
</div>
<div class="section-level-extent" id="Twiggs-Money-Flow">

xtools/my-deb.sh  view on Meta::CPAN

  echo "DISTVNAME not found"
  exit 1
fi
DISTVNAME=`echo "$DISTVNAME" | sed "s/[$][(]VERSION[)]/$VERSION/"`
DISTVNAME=`echo "$DISTVNAME" | sed "s/[$][(]DISTNAME[)]/$DISTNAME/"`
echo "DISTVNAME  $DISTVNAME"

XS_FILES=`sed -n 's/^XS_FILES = \(.*\)/\1/p' Makefile`
EXE_FILES=`sed -n 's/^EXE_FILES = \(.*\)/\1/p' Makefile`

if test "$DISTNAME" = pngtextadd -o "$DISTNAME" = x2gpm
then DPKG_ARCH=`dpkg --print-architecture`
elif test -n "$XS_FILES"
then DPKG_ARCH=`dpkg --print-architecture`
else DPKG_ARCH=all
fi
echo "DPKG_ARCH  $DPKG_ARCH"

# programs named after the dist, libraries named with "lib"
# gtk2-ex-splash and wx-perl-podbrowser programs are lib too though
DEBNAME=`echo $DISTNAME | tr A-Z a-z`

xtools/my-pc.sh  view on Meta::CPAN

  fi
done



# perl -e 'use Test::Vars; all_vars_ok()'
# MyMakeMakerExtras_Pod_Coverage

perl -e 'use Pod::Coverage package => $class'

podlinkcheck -I lib `ls $LINT_FILES | grep -v '\.bash$$|\.desktop$$\.png$$|\.xpm$$'`

podchecker -nowarnings `ls $LINT_FILES | grep -v '\.bash$$|\.desktop$$\.png$$|\.xpm$$'`
perlcritic $LINT_FILES



( run in 2.001 seconds using v1.01-cache-2.11-cpan-df04353d9ac )