App-Chart
view release on metacpan or search on metacpan
doc/chart.texi view on Meta::CPAN
@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
@section Main Window
@cindex Main window
@cindex Window, main
@cindex Graph
@cindex OHLC
@cindex Weekly
@cindex Monthly
@cindex @key{Ctrl-D}
@cindex @key{Ctrl-W}
@cindex @key{Ctrl-M}
The default display is daily open/high/low/close candlesticks with volume
below. @key{Ctrl-W} selects a weekly display, or @key{Ctrl-M} monthly.
@key{Ctrl-D} goes back to daily.
@cindex Scroll
@cindex Centre
@cindex @key{Page-Up}
@cindex @key{Page-Down}
@cindex @key{Ctrl-C}
@cindex @key{Button-1}
The scroll bars move the visible portion. Arrow keys @key{Up}, @key{Down},
etc move by a step, or control-arrows and @key{Page-Up}/@key{Page-Down} move
by a page. Mouse @key{Button-1} drags the graph within the window.
@key{Ctrl-C} centres it vertically in the window, if you lose track when
paging around.
@cindex Zoom
@cindex @key{Z}
@cindex @key{Shift-Z}
@cindex @key{W}
@cindex @key{Shift-W}
@key{Z} and @key{Shift-Z} zoom in and out vertically. @key{W} and
@key{Shift-W} zoom in and out horizontally (@samp{W} stands for ``wider'').
The initial vertical scaling is based on apparent price volatility, so active
stocks take the full window (or more), and sedate stocks are shown fairly
flat.
@cindex Latest
During trading, the current day's open/high/low/last so far is shown in yellow
(to emphasise it's a latest quote). This is always in OHLC style, even on a
candlestick chart. The figure drawn looks like
@ifnottex
@example
|
|
+--
|
+-----
|
+--
|
--+
|
|
@end example
@end ifnottex
@tex
{\hfill
\vbox to 12 ex{%
\vskip 8.5 ex
\hrule width 1.5 ex height 1 ex
\vfill
}\vbox to 12 ex {%
\hbox{\vrule width 1 ex height 12 ex}
\vfill
}\vbox to 12 ex {%
\vskip 2 ex
\hrule width 1.5 ex height 1 ex
\vskip 1.5 ex
\hrule width 3.5 ex height 1 ex
\vskip 1.5 ex
\hrule width 1.5 ex height 1 ex
\vfill
}\hfill}
@end tex
The left line is the open as usual. The long line on the right is the last
trade, and the surrounding shorter lines are the current bid and offer. The
last trade might be equal to the bid or offer, overlapping it, or they might
surround the last, as shown here. In any case this figure gives the current
day visually.
@c ---------------------------------------------------------------------------
@node View Style, Dividends, Main Window, Display
@section View Style
@cindex Style
@cindex View style
@cindex Dialog, view style
@cindex Edit/Viewstyle
@cindex OHLC
@cindex Candles
@cindex Line style
@cindex HL, line style
@cindex Solid, line style
@cindex Splits, adjustment
@cindex Stock splits, adjustment
@cindex Dividends, adjustment
@cindex Futures, rollover
doc/chart.texi view on Meta::CPAN
* R-Squared Index::
* RAVI::
* Relative Strength Index::
* Relative Volatility Index::
* Random Walk Index::
* Stochastics::
* TD Range Expansion Index::
* Trend Intensity Index::
* Trendscore::
* True Strength Index::
* TRIX::
* Twiggs Money Flow::
* Ulcer Index::
* Ultimate Oscillator::
* Vertical Horizontal Filter::
* Volatility Ratio::
* Williams %R::
* Williams Accumulation/Distribution::
* Zig Zag Indicator::
@end menu
@c ---------------------------------------------------------------------------
@node Accumulation/Distribution, Accumulative Swing Index, Indicators, Indicators
@section Accumulation/Distribution
@cindex Accumulation/distribution
@cindex Index, accumulation/distribution
@cindex Chaikin, Marc
The Accumulation/Distribution index by Marc Chaikin is a cumulative total
volume, with volume each day added or subtracted in proportion to where the
close is between that day's high and low. For @var{c}, @var{h}, @var{l},
@var{v} and with @ms{AD,prev} as yesterday's Acc/Dist the formula is
@tex
$$ AD = AD_{prev} + v \> \left( 2 \, {{c-l} \over {h-l}} - 1 \right) $$
@end tex
@ifnottex
@example
C - L
AD = ADprev + V * (2 * ----- - 1)
H - L
@end example
@end ifnottex
When the close is at the high the factor is @math{+1} and the full volume is
added in, when the close is at the low the factor is @math{-1} and the full
volume is subtracted. In between is in proportion, so for instance a close at
75% of the range would be a factor @math{+0.5}, or a close midway would be a
factor 0 for no change to the Acc/Dist.
The starting point (ie.@: the zero point) for the running total is arbitrary.
In Chart it's merely the segment of data first displayed.
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.
Acc/Dist is somewhat similar to On-Balance Volume (@pxref{On-Balance Volume}).
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 @ref{Chaikin Money Flow}.
@c ---------------------------------------------------------------------------
@node Accumulative Swing Index, Aroon, Accumulation/Distribution, Indicators
@section Accumulative Swing Index
@cindex Accumulative swing index
@cindex ASI
@cindex Index, accumulative swing
@cindex Wilder, J. Welles
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.
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.
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.
@anchor{Swing Index}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).
@c ---------------------------------------------------------------------------
@node Aroon, Average True Range, Accumulative Swing Index, Indicators
@section Aroon
@cindex Aroon
@cindex Chande, Tushar
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.
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.
The Aroon Oscillator is simply the difference between the Up and Down lines,
@tex
$$ AroonOsc = AroonUp - AroonDown $$
@end tex
@ifnottex
@example
AroonOsc = AroonUp - AroonDown
@end example
@end ifnottex
In Chart the Up line is drawn in green, the down in red, and the oscillator in
white.
doc/chart.texi view on Meta::CPAN
@end tex
@ifnottex
@example
S = Stddev[10 days]
U = / S if price > prev price
\ 0 otherwise
EMA[W14] of U
RVIorig = 100 * -------------
EMA[W14] of S
@end example
@end ifnottex
In 1995 Dorsey revised his idea, to apply RVI to the daily highs and daily
lows and average the result, thus the following, which is the RVI used in
Chart.
@tex
$$ RVIorig = { RVIorig\;of\;highs + RVIorig\;of\;lows \over 2 } $$
@end tex
@ifnottex
@example
RVIorig of highs + RVIorig of lows
RVI = ----------------------------------
2
@end example
@end ifnottex
When a data source doesn't provide high/low values just the closes are used,
which ends up as Dorsey's original. The stddev period of 10 days and the
default EMA of 14 days are parameters (@pxref{View Style}). The EMA period
follows J.@: Welles Wilder's reckoning (@pxref{Wilder EMA period}), the same
as an RSI.
@anchor{Inertia}
@section Inertia
@cindex Inertia
Dorsey also smoothed the RVI with a 20-day least squares moving average
(LSQMA, @pxref{Endpoint Moving Average}) and called the result the inertia
indicator. The 20-day smoothing period is a parameter.
An LSQMA can of course also be applied to an RVI directly, this can be good to
see how it smooths. But inertia is offered as a separate selection since the
smoothed line tends to follow the raw RVI quite closely, making it hard to see
which is which.
@c ---------------------------------------------------------------------------
@node Random Walk Index, Stochastics, Relative Volatility Index, Indicators
@section Random Walk Index
@cindex Random walk index
@cindex Index, random walk
@cindex RWI
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.
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
@tex
$$ { High[today] - Low[K] \over Average TR [K] } \times { 1 \over \sqrt K } $$
@end tex
@ifnottex
@example
High[today] - Low[K] 1
-------------------- * ------
Average TR [K] sqrt(K)
@end example
@end ifnottex
which is the move from the low K days ago up to today's high, scaled by an
average of the true range (TR, @pxref{True Range}). 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 @math{High[K]
- Low[today]} for the movement down from past high to today's low.
The factor @m{\sqrt K, sqrt(K)} 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 @m{\sqrt K, sqrt(K)}. So the formula compares observed distance in
average day's steps compared to the @m{\sqrt K, sqrt(K)} 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.
@c ---------------------------------------------------------------------------
@node Stochastics, TD Range Expansion Index, Random Walk Index, Indicators
@section Stochastics
@cindex Stochastics
@cindex Lane, George
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.
@cindex %K stochastic
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.
@tex
$$ \%K = 100 \times {{close - Nday\;low} \over Nday\;high - Nday\;low } $$
@end tex
@ifnottex
@example
close - Nday low
%K = 100 * --------------------
Nday high - Nday low
@end example
@end ifnottex
@cindex %D stochastic
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
(@pxref{Simple Moving Average}).
@tex
$$ \%D = SMA[D] \; of \; \%K $$
@end tex
@ifnottex
@example
%D = SMA[D] of %K
@end example
@end ifnottex
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.
@cindex Fast stochastics
@cindex Slow stochastics
%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.
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.
@c ---------------------------------------------------------------------------
@node TD Range Expansion Index, Trend Intensity Index, Stochastics, Indicators
@section TD Range Expansion Index
@cindex TD range expansion index
@cindex Range expansion index
@cindex TDREI
@cindex DeMark, Tom
The range expansion index by Tom DeMark is designed to identify price
exhaustion which may be the end of a move up or down.
The calculation is somewhat similar to an RSI (@pxref{Relative Strength
Index}) but looks at 2-day changes in the daily high and daily low values and
smooths with a 5-day SMA (@pxref{Simple Moving Average}). 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.
DeMark regarded values above @math{+45} or below @math{-45} 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.
@c ---------------------------------------------------------------------------
@node Trend Intensity Index, Trendscore, TD Range Expansion Index, Indicators
@section Trend Intensity Index
@cindex Trend intensity index
@cindex TII
@cindex Pee, M. H.
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
(@pxref{Simple Moving Average}).
The 60-day average is as of today, not its past values at each of
those past 30 days. For each day the deviation @math{close-avg} is
taken. Positive amounts are up deviations, and negative amounts have
the sign discarded and are down deviations.
@tex
$$ up = \left\{
\matrix{ close - average & \mathop{\rm if} \; close > average \cr
0 & otherwise \hfill \cr
} \right. $$
$$ down = \left\{
\matrix{ average - close & \mathop{\rm if} \; average > close \cr
0 & otherwise \hfill \cr
} \right. $$
@end tex
@ifnottex
@example
up = / close - average if close > average
\ 0 otherwise
down = / average - close if average < close
\ 0 otherwise
@end example
@end ifnottex
The percentage of the total up amounts out of total up and down amounts is
then the trend intensity index,
@tex
$$ RVIorig = 100 \times { total \; up
\over total \; up + total \; down } $$
@end tex
@ifnottex
@example
total up
TDI = 100 * ---------------------
total up + total down
doc/chart.texi view on Meta::CPAN
@c Gettext (@CHARTpxreftop{gettext, GNU @command{gettext} utilities}). @*
@c @uref{http://www.gnu.org/software/gettext/}
@item Stock and commodity names
@cindex Stock name translations
@cindex Commodity name translations
@cindex Name translations
@cindex Weblink
Names are downloaded in the selected or highest preference language, when
there's a choice. Weblinks to company information or the exchange home page
likewise.
@item Annotations
@cindex Annotation locale
@cindex UTF-8
Annotation notes (@pxref{Annotations}) can be entered with unicode characters.
@c , Dividends
@c and dividends (@pxref{Dividends}) ...
@end table
@c @ifinfo
@c @sp 1
@c @end ifinfo
@section Locale Selection
@cindex Locale selection
@cindex Language
@cindex @env{LANG}
On a typical Unix/POSIX-style system the locale is selected with the
@env{LANG} environment variable, set to a language code and optional territory
and charset. For example US English,
@example
LANG=en_US
export LANG
@end example
This is often set by the system administrator, but you can do it yourself in
your @file{~/.profile} (@pxref{Bash Startup Files,,, bashref, Bash Features}).
@cindex Language codes
@cindex Country codes
Language and country codes can be found in @ref{Language Codes,,, gettext, GNU
@command{gettext} utilities}, and @ref{Country Codes,,, gettext, GNU
@command{gettext} utilities}. Usually there's only a few combinations
available on a system, run @samp{locale -a} to see them.
@cindex @env{LANGUAGE}
Additionally, on a GNU system the @env{LANGUAGE} environment variable gives a
list of language preferences for message translations (@pxref{Using
gettextized software,, User influence on @code{gettext}, libc, GNU C Library
Reference Manual}). For example to have Italian preferred, otherwise Spanish,
otherwise English,
@example
LANGUAGE=it_IT:es:en
export LANGUAGE
@end example
Chart looks at @env{LANGUAGE} too (on all systems) for the preferred language
for stock and commodity names.
@c ---------------------------------------------------------------------------
@node Emacs, Concept Index, Internationalization, Top
@chapter Emacs
@cindex Emacs
@uref{http://www.gnu.org/software/emacs/}
@cindex @file{chartprog.el}
@cindex XEmacs
@file{chartprog.el} shows the Chart watchlist and gets quotes within Emacs
(@CHARTpxreftop{emacs, The Emacs Editor}). It's designed for Emacs 21 and
higher, and also works with XEmacs 21 if you have the UTF-8 coding system (see
below).
@cindex Autoload @file{chartprog.el}
@cindex @file{chartprog-loaddefs.el}
@cindex @file{.emacs}
The Debian package has the following setups already. Otherwise, the best way
to use @file{chartprog.el} is with autoloads for the commands.
@file{chartprog-loaddefs.el} is a small file which sets this up. Add the
following to your @file{.emacs} file (@pxref{Init File,, The Init File
@file{~/.emacs}, emacs, The Emacs Editor}),
@lisp
(require 'chartprog-loaddefs)
@end lisp
@cindex @code{load-path}
@cindex @code{site-lisp}
The build system currently doesn't install @file{chartprog.el} into
@file{site-lisp}, so you should copy it and @file{chartprog-loaddefs.el} to
somewhere in your @code{load-path} (@pxref{Lisp Libraries,, Libraries of Lisp
Code for Emacs, emacs, The Emacs Editor}).
@c If Chart isn't installed in a standard location you'll need to add its lisp
@c directory (@file{$prefix/share/emacs/site-lisp}) to your Emacs
@c @code{load-path}
@section Watchlist and Quotes
@findex @code{chart-watchlist}
@kbd{M-x chart-watchlist} displays the Favourites list in a buffer. Key
@key{a} adds a symbol. @kbd{C-k} and @kbd{C-y} kill and yank symbols.
@key{g} refreshes the quotes. @key{L} selects a different list (like the
Alerts list). The usual @kbd{C-h m} mode help shows other key bindings.
Chart communicates changes to the lists between the Emacs display and a
running Chart GUI@. So if you have both open then changes in one are
reflected in the other a moment later.
@findex @code{chart-quote}
@kbd{M-x chart-quote} displays a quote for a given symbol in the message area.
It prompts for the symbol with default a symbol at point. @key{Tab}
completion is available (@pxref{Completion,,, emacs, The Emacs Editor}) using
the database symbols, favourites list, and previously requested symbols.
( run in 1.559 second using v1.01-cache-2.11-cpan-39bf76dae61 )