view release on metacpan or search on metacpan
=item --download
Download data for the given symbols, lists, or wildcards instead of running
the GUI. For example
chart --download BHP.AX GM
chart --download "*.NZ"
chart --download --all
Wildcards usually have to be quoted to stop the shell expanding them as
filenames. On a tty a status line is shown with progress.
=item --all
The "All" list of all current symbols (ie. non-historical) for download
etc.
=item --alerts
The "Alerts" list of symbols for download etc.
devel/misc.el view on Meta::CPAN
;;-----------------------------------------------------------------------------
(chartprog-symlist-editable-p 'favourites)
(chartprog-symlist-editable-p 'alerts)
(require 'chartprog)
(chartprog-completing-read-symlist)
;;-----------------------------------------------------------------------------
(progn
(add-to-list 'load-path (expand-file-name "."))
(require 'my-byte-compile)
(my-byte-compile "../emacs/chartprog.el"))
(progn
(add-to-list 'load-path (expand-file-name "."))
(require 'my-byte-compile)
(my-show-autoloads))
;;-----------------------------------------------------------------------------
;; ;; emacs has `compare-strings' to do this, but xemacs doesn't
;; (defun chartprog-string-prefix-ci-p (part str)
;; "Return t if PART is a prefix of STR, case insensitive."
;; (and (>= (length str) (length part))
doc/chart.texi view on Meta::CPAN
stock with no data means do an initial download.) For example,
@example
chart --download TSCO.L RNO.PA FBU.NZ BMW.DE
@end example
@c SYMBOL: TSCO.L
@c SYMBOL: RNO.PA
@c SYMBOL: FBU.NZ
@c SYMBOL: BMW.DE
The TreeView in the dialog has an irritating animated arrow when expanding or
collapsing a symlist. You can fix that for Chart and other Gtk2 by adding to
your @file{~/.gtkrc-2.0} file
@example
gtk-enable-animations = 0
@end example
@c ---------------------------------------------------------------------------
@node Main Window, View Style, Open, Display
doc/chart.texi view on Meta::CPAN
term and six long term exponential moving averages (@pxref{Exponential Moving
Average}), all drawn on the one chart.
His standard periods are 3, 5, 8, 10, 12 and 15 days for the short averages,
and 30, 35, 40, 45, 50 and 60 days for the long averages. These periods are
parameters in Chart to allow experimentation. A value of 0 suppresses an
entry if less than twelve lines are desired.
Guppy's approach is look for compression of the averages (the lines coming
together) in each group as signalling a likely trend change; and for steady
parallel or expanding lines as a continuing trend. He emphasises that the
idea is not a moving average crossover system.
@subsection Additional Resources
@itemize
@item
@uref{http://www.incrediblecharts.com/technical/multiple_moving_averages.htm}
-- sample graph of @samp{ASX.AX} from 1999.
@end itemize
lib/App/Chart/Gtk2/AdjScale.pm view on Meta::CPAN
# details.
#
# You should have received a copy of the GNU General Public License along
# with Chart. If not, see <http://www.gnu.org/licenses/>.
# gravity up,down,centre
# stick to start/end if already there
# which of upper/lower to grow
# set_page_range wait until first size_allocate to decide vpp,ppv
# choice keep vpp same and expand page, or keep page and adjust vpp
# integer ppv
package App::Chart::Gtk2::AdjScale;
use 5.008;
use strict;
use warnings;
use Glib::Ex::FreezeNotify;
use Glib::Ex::SignalIds;
lib/App/Chart/Gtk2/Graph.pm view on Meta::CPAN
if (my ($p_lo, $p_hi) = $series->initial_range ($lo, $hi)) {
### series initial_range(): ($p_lo//'undef')." to ".($p_hi//'undef')." from $lo to $hi on ".ref($series)
($p_lo, $p_hi) = stretch_range ($p_lo, $p_hi);
### stretched to: ($p_lo//'undef')." to ".($p_hi//'undef')
if (defined $p_lo) {
$vadj->set_page_range ($p_lo, $p_hi);
}
$self->queue_draw;
}
# expanding on initial ...
$self->{'vrange_span'} = undef;
update_v_range ($self);
}
# 'set-scroll-adjustments' class closure
sub _do_set_scroll_adjustments {
my ($self, $hadj, $vadj) = @_;
$self->set (hadjustment => $hadj,
vadjustment => $vadj);
}
lib/App/Chart/Gtk2/Graph.pm view on Meta::CPAN
}
# Expand $adj so its lower/upper covers all of @values.
#
# If lower==upper==page_size==0 in the existing $adj settings it's treated
# as uninitialized and that 0 lower/upper is ignored, just @values is used.
#
# undefs in @values are ignored, and if all are undef then $adj is not
# changed.
#
sub adjustment_expand {
my ($adj, @values) = @_;
@values = grep {defined} @values;
### Graph adjustment_expand(): join(' ',@values)
if (! @values) { return; }
my ($new_lower, $new_upper) = List::MoreUtils::minmax (@values);
### base: " new_lower $new_lower new_upper $new_upper"
($new_lower, $new_upper) = stretch_range ($new_lower, $new_upper);
### stretch: "new_lower $new_lower new_upper $new_upper"
my $old_lower = $adj->lower;
my $old_upper = $adj->upper;
### old: " old_lower $old_lower old_upper $old_upper old_page ".$adj->page_size
lib/App/Chart/Gtk2/Graph.pm view on Meta::CPAN
my ($lo, $hi) = $self->draw_t_range;
my $vrange_span = ($self->{'vrange_span'} ||= do {
require Set::IntSpan::Fast;
Set::IntSpan::Fast->new
});
if ($vrange_span->contains_all_range ($lo, $hi)) { return; }
### Graph update_v_range for: "$lo to $hi"
my $series_list = $self->{'series_list'};
adjustment_expand ($vadj,
(map {
$_->vrange ($self, $series_list);
} @plugins),
(map {
_series_v_range($_, $lo, $hi)
} @$series_list));
$vrange_span->add_range ($lo, $hi);
}
sub _series_v_range {
my ($series, $lo, $hi) = @_;
lib/App/Chart/Gtk2/Graph.pm view on Meta::CPAN
foreach my $array (@arrays) {
$accumulate->($array->[$i])
or last OUTER;
}
}
if (! defined $l) { return; }
### decided: "$l to $h"
my $extra = $page - ($h - $l);
$l -= $extra / 2;
### expand to: "low $l on page $page"
$vadj->set_value ($l);
}
#------------------------------------------------------------------------------
# scrolling
# 'scroll-event' class closure
sub _do_scroll_event {
my ($self, $event) = @_;
lib/App/Chart/Gtk2/OpenDialog.pm view on Meta::CPAN
my $treeview = $self->{'treeview'} = Gtk2::TreeView->new_with_model ($model);
$treeview->set (reorderable => 1,
headers_visible => 0,
fixed_height_mode => 1,
search_column => $model->COL_ITEM_SYMBOL);
$treeview->signal_connect (row_activated => \&_do_row_activated);
$scrolled->add ($treeview);
foreach my $key ('all', 'favourites') {
if (my $path = $model->path_for_key ($key)) {
$treeview->expand_row($path, 0);
}
}
my $selection = $treeview->get_selection();
$selection->set_mode ('single');
my $renderer = Gtk2::CellRendererText->new;
$renderer->set (xalign => 0, # left justify
ypad => 0);
$renderer->set_fixed_height_from_font (1);
lib/App/Chart/Gtk2/View.pm view on Meta::CPAN
App::Chart::Gtk2::GUI::chart_style_widget ('AppChartViewLabel');
my $ebox = $self->{'initial'} = Gtk2::EventBox->new;
$ebox->set_name ('AppChartViewLabel');
my $label = Gtk2::Label->new
(__('Use File/Open to open or add a symbol'));
$label->set_name ('AppChartViewLabel');
$ebox->add ($label);
$ebox->show_all;
$self->attach ($ebox, 0,3, 0,9,
['fill','shrink','expand'],
['fill','shrink','expand'], 0,0);
}
sub GET_PROPERTY {
my ($self, $pspec) = @_;
my $pname = $pspec->get_name;
if ($pname eq 'viewstyle') {
if (! $self->{'init_graphs'}) {
return viewstyle_read();
}
}
lib/App/Chart/Gtk2/View.pm view on Meta::CPAN
# | hscroll | |
# 9 +--------------+--+--+
#
sub _update_attach {
my ($self) = @_;
require Gtk2::Ex::TableBits;
my $y = 0;
Gtk2::Ex::TableBits::update_attach
($self, $self->{'heading'}, 0,3, $y,$y+1,
['fill','shrink','expand'], [], 0,0);
$y++;
my $graphs = $self->{'graphs'};
my @graphstyles = @{$self->{'viewstyle'}->{'graphs'}};
while ($#$graphs > max (0, $#graphstyles)) {
my $graph = pop @$graphs;
$self->remove ($graph);
$self->remove ($graph->{'noshrink'});
$self->remove ($graph->{'vscroll'});
}
lib/App/Chart/Gtk2/View.pm view on Meta::CPAN
($self, $gap, 0,3, $y,$y+1,
[], [], 0,0);
$y++;
}
my $graphstyle = $graphstyles[$i];
my $size = $graphstyle->{'size'};
Gtk2::Ex::TableBits::update_attach
($self, $graph, 0,1, $y,$y+$size,
['fill','shrink','expand'],
['fill','shrink','expand'], 0,0);
Gtk2::Ex::TableBits::update_attach
($self, $graph->{'noshrink'},
1,2, $y,$y+$size,
['fill','shrink'],
['fill','shrink','expand'], 0,0);
Gtk2::Ex::TableBits::update_attach
($self, $graph->{'vscroll'},
2,3, $y,$y+$size,
['fill','shrink'],
['fill','shrink','expand'], 0,0);
$y += $size;
}
Gtk2::Ex::TableBits::update_attach
($self, $self->{'haxis'}, 0,1, $y,$y+1,
['fill','shrink','expand'],
['fill','shrink'], 0,0);
$y++;
Gtk2::Ex::TableBits::update_attach
($self, $self->{'hscroll'}, 0,1, $y,$y+1,
['fill','shrink','expand'],
['fill','shrink'], 0,0);
$y++;
if (my $cross = $self->{'crosshair_object'}) {
### _update_attach() cross widgets: "@$graphs"
$cross->set (widgets => $graphs);
}
$self->resize (3, $y);
}
lib/App/Chart/LatestHandler.pm view on Meta::CPAN
my $err = $@;
unless (utf8::is_utf8($err)) { $err = Encode::decode('locale',$err); }
print "Latest download error: ", $err, "\n";
if (defined $trace) {
print $trace->as_string, "\n";
}
}
}
}
sub expand_arguments {
my ($args) = @_;
my @symbol_list = ();
foreach my $arg (@$args) {
if (ref $arg) {
push @symbol_list, $arg->symbols;
} else {
push @symbol_list, App::Chart::Download::symbol_glob ($arg);
}
}
return @symbol_list;
}
sub command_line_download {
my ($class, $args) = @_;
my @symbol_list = expand_arguments ($args);
$class->download (\@symbol_list, []);
}
1;
__END__
=for stopwords intraday undef
lib/App/Chart/Series.pm view on Meta::CPAN
### series range: "$l to $h"
$page = min ($page, 2 * ($h - $l));
}
}
### shrink to use minimum half window: $page
# make page no smaller than last 1/2 of data, so that's visible
{ my ($l, $h) = $self->range (CORE::int (($lo + $hi) / 2), $hi);
if ($l) { $page = max ($page, $h - $l); }
}
### expand so last half data visible: $page
my ($l, $h);
my $accumulate = sub {
my ($value) = @_;
### accumulate: $value
if (! defined $value) { return 1; }
my $new_l = defined $l ? min ($value, $l) : $value;
my $new_h = defined $h ? max ($value, $h) : $value;
if ($new_h - $new_l <= $page) {
$l = $new_l;
lib/App/Chart/doc/chart.html view on Meta::CPAN
<p>When adding a lot of new symbols the command line download
(see <a class="pxref" href="#Invocation">Invocation</a>) may be easier than entering them individually in the GUI.
You can give a long list and let Chart go away and do all the initial
downloads. (The command is the same as an “update”, because an update of a
stock with no data means do an initial download.) For example,
</p>
<div class="example">
<pre class="example-preformatted">chart --download TSCO.L RNO.PA FBU.NZ BMW.DE
</pre></div>
<p>The TreeView in the dialog has an irritating animated arrow when expanding or
collapsing a symlist. You can fix that for Chart and other Gtk2 by adding to
your <samp class="file">~/.gtkrc-2.0</samp> file
</p>
<div class="example">
<pre class="example-preformatted">gtk-enable-animations = 0
</pre></div>
<hr>
</div>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<p>The Guppy multiple moving average (GMMA) by Darryl Guppy is a set of six short
term and six long term exponential moving averages (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>), all drawn on the one chart.
</p>
<p>His standard periods are 3, 5, 8, 10, 12 and 15 days for the short averages,
and 30, 35, 40, 45, 50 and 60 days for the long averages. These periods are
parameters in Chart to allow experimentation. A value of 0 suppresses an
entry if less than twelve lines are desired.
</p>
<p>Guppy’s approach is look for compression of the averages (the lines coming
together) in each group as signalling a likely trend change; and for steady
parallel or expanding lines as a continuing trend. He emphasises that the
idea is not a moving average crossover system.
</p>
<ul class="mini-toc">
<li><a href="#Additional-Resources-1" accesskey="1">Additional Resources</a></li>
</ul>
<div class="subsection-level-extent" id="Additional-Resources-1">
<h4 class="subsection"><span>8.7.1 Additional Resources<a class="copiable-link" href="#Additional-Resources-1"> ¶</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.incrediblecharts.com/technical/multiple_moving_averages.htm">http://www.incrediblecharts.com/technical/multiple_moving_averages.htm</a>
maybe/BrowseHistoryDialog.pm view on Meta::CPAN
my $table = Gtk2::Table->new (1, 2);
$vbox->pack_start ($table, 0,0,0);
my $tpos = 0;
foreach my $i (0, 1) {
my $type = ('back', 'forward')[$i];
my $scrolled = $self->{"scrolled_$type"} = Gtk2::ScrolledWindow->new;
$scrolled->set (hscrollbar_policy => 'automatic',
vscrollbar_policy => 'automatic');
$table->attach ($scrolled, $tpos, $tpos+1, 0,1,
['fill','shrink','expand'],
['fill','shrink','expand'],
POSIX::ceil(Gtk2::Ex::Units::width($table,'.2 em')), 0);
$tpos++;
my $treeview = $self->{"treeview_$type"} = Gtk2::TreeView->new;
$treeview->set (headers_visible => 1,
reorderable => 0);
$treeview->signal_connect (row_activated => \&_do_row_activated);
$scrolled->add ($treeview);
my $renderer = Gtk2::CellRendererText->new;