App-Chart
view release on metacpan or search on metacpan
doc/chart.texi view on Meta::CPAN
@c FIXME: not included yet
@c the only the BSX and ZSE servers are known
@c to take advantage of this (@pxref{Bendigo Stock Exchange}, and @ref{Zagreb
@c Stock Exchange}).
@item HTTPS
@cindex @code{https}
@cindex SSL
@cindex OpenSSL
For @code{https} protocol the @code{LWP::Protocol::https} module is required.
In libwww 6 and up it comes separately and expresses its required supporting
modules. In libwww 5 see its @file{README.SSL} on the recommended
@code{Crypt::SSLeay} module (using OpenSSL)@. Many data sources need
@code{https}, including @ref{Yahoo Finance}.
@c @item @command{lha}
@c @cindex LHa
@c @cindex LZH
@c The LHa archive program (@pxref{References}) is required for data sources in
@c LZH format (@pxref{Kansai Commodities Exchange, KEX}).
@c
@item Documentation
@cindex Documentation
@cindex Manual
@cindex Texinfo manual
@cindex @TeX{} manual
The source for the manual you're now reading is @file{doc/chart.texi}, in
Texinfo format (@CHARTpxreftop{texinfo, Texinfo}).
@cindex HTML manual
@cindex Info manual
@cindex PostScript manual
@cindex PDF manual
@cindex DVI manual
HTML format @file{chart.html} is installed as
@file{lib/App/Chart/doc/chart.html} with the source code. It can be viewed
with the Help commands within Chart, or with any browser. The following
@command{make} targets can build other formats,
@example
make info # Info
make dvi # TeX DVI
make ps # PostScript
make pdf # PDF
@end example
producing files @file{doc/chart.info}, @file{doc/chart.dvi}, etc. They need
enough of Chart's Perl dependencies installed to run the @file{doc/weights.pl}
script, then Info requires @command{makeinfo} (@pxref{Creating an Info File,,,
texinfo, Texinfo}) and DVI, PS and PDF require various @TeX{} and Texinfo
tools. PDF also requires either @command{epstopdf} from Texlive or TeTeX, or
@command{ps2pdf} from Ghostscript.
@cindex DocBook manual
@cindex XML manual
@command{makeinfo} can produce other formats, including DocBook and XML
(@pxref{makeinfo options,, Options for @command{makeinfo}, texinfo, Texinfo}).
@item Scrollkeeper
@cindex OMF
@cindex Open metadata framework
@cindex Scrollkeeper
@cindex Yelp
@cindex @command{gnome-help}
A Scrollkeeper entry
(@uref{http://scrollkeeper.sourceforge.net}) @file{doc/chart.omf} is included
for the manual (HTML form). It can be used by Gnome help (Yelp) and similar
programs. Currently it's not automatically installed but you can copy to
@file{/usr/share/omf/chart/chart.omf} and run @command{scrollkeeper-update}.
@item User Directory
@cindex User directory
@cindex @env{CHART_DIRECTORY}
The default directory for Chart downloaded data and configurations is
@file{~/Chart}, ie.@: a @file{Chart} subdirectory of the user's home
directory. The @env{CHART_DIRECTORY} environment variable can be set to a
different directory if something else is preferred, or perhaps to experiment
or keep some things separate.
@end table
@c ---------------------------------------------------------------------------
@node Invocation, Symbol Lists, Installing, Top
@chapter Invocation
@cindex Invocation
@cindex Command line
@cindex Options
@cindex @command{chart}
@noindent
The Chart command line is
@example
chart [--options] [symbol@dots{}]
@end example
The default is to run the Gtk graphical interface. The optional @var{symbol}
is an initial symbol to display.
@var{symbol} can be a partial name and is matched against the database the
same way as in the Open dialog (@pxref{Open}). So if @code{TSCO.L} is the
only thing in the database starting with ``TS'' then just @samp{chart ts} is
enough, or similarly for @code{^GSPC} just @samp{chart gsp} may be enough.
The graphical options are
@table @asis
@item @option{--display=@var{dpy}}
@cindex @option{--display}
@cindex @env{DISPLAY}
Start on the given display @var{dpy}. The default is the usual @env{DISPLAY}
environment variable, which should be set as part of X startup, and shouldn't
need to be overridden. See @command{man X} for more.
@item @option{--watchlist}
@cindex @option{--watchlist}
@cindex Ticker, stand alone
Start with just the Watchlist dialog (@pxref{Watchlist}). The initial list
displayed is selected by the symbol options like @samp{--all} below.
doc/chart.texi view on Meta::CPAN
@c ---------------------------------------------------------------------------
@node R-Squared Index, RAVI, QStick, Indicators
@section R-Squared Index
@cindex R-squared index
@cindex Index, R-Squared
@cindex Chande, Tushar
@cindex Kroll, Stanley
@cindex Correlation coefficient
@cindex Coefficient, correlation
@cindex Coefficient of determination
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 @dfn{coefficient of determination}
of the prices versus a straight line. This coefficient is written @math{r^2},
hence the name of the indicator.
For reference, the formulas are as follows, where X values are the closing
prices and Y values are a straight line 1,2,@dots{},N@. Variance is the
square of standard deviation (@pxref{Standard Deviation}).
@tex
$$ r^2 = { (\mathop{Covariance} X,Y)^2
\over (\mathop{Variance} X) (\mathop{Variance} Y) } $$
$$ \mathop{Covariance} X,Y = \mathop{Mean} (XY)
- (\mathop{Mean} X) (\mathop{Mean} Y) $$
$$ \mathop{Variance} X = \mathop{Mean} (X^2) - (\mathop{Mean} X)^2 $$
@end tex
@ifnottex
@example
(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
@end example
@end ifnottex
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.
Chande and Kroll suggested using a 14-day period, and that's the default in
Chart.
@c FIXME
@c They also described a 14-day simple moving average (@pxref{Simple
@c Moving Average}) on the raw values, and that can be shown in Chart the same as
@c any average on an indicator (@pxref{View Style}).
@c ---------------------------------------------------------------------------
@node RAVI, Relative Strength Index, R-Squared Index, Indicators
@section RAVI
@cindex RAVI
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
(@pxref{Simple Moving Average}). The defaults are 7 days and 65 days.
@tex
$$ RAVI = 100 \times { | SMA[short] - SMA[long] | \over SMA[long] }$$
@end tex
@ifnottex
@example
abs (SMA[short] - SMA[long])
RAVI = 100 * ----------------------------
SMA[long]
@end example
@end ifnottex
@c ---------------------------------------------------------------------------
@node Relative Strength Index, Relative Volatility Index, RAVI, Indicators
@section Relative Strength Index
@cindex Relative strength index
@cindex RSI
@cindex Index, relative strength
@cindex Wilder, J. Welles
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 (@pxref{Exponential Moving Average}).
For each day an upward or downward movement is calculated. On an up day
@tex
$$ U = close_{today} - close_{yesterday} $$
$$ D = 0 $$
@end tex
@ifnottex
@example
U = close[today] - close[yesterday]
D = 0
@end example
@end ifnottex
or on a down day as follows (notice D is a positive amount),
@tex
$$ U = 0 $$
$$ D = close_{yesterday} - close_{today} $$
@end tex
@ifnottex
@example
U = 0
D = close[yesterday] - close[today]
@end example
@end ifnottex
The sequence of U values over time is averaged with an EMA
(@pxref{Exponential Moving Average}) and likewise the D values. The
ratio is the ``relative strength'',
@tex
$$ RS = { EMA[N] \, of \, U \over EMA[N] \, of \, D } $$
@end tex
@ifnottex
doc/chart.texi view on Meta::CPAN
@item Displayed List
The displayed list can be selected from a menu with Button-3 in the upper left
notebook tab, where the current list name is displayed.
The ``Symlists'' tab shows the available lists. New lists can be created from
there, or the names of existing user lists changed. Double clicking displays
the list. Use the ``Edit Name'' button in the action area to change a name.
The order of the lists controls how they appear in the Open dialog
(@pxref{Open}) and the sequence for Next and Prev in the main display. You
can drag rows to re-order.
@item Colours
Each line is shown in green for a last trade higher than yesterday's close,
red for lower, or black unchanged. Blue means a refresh download is in
progress.
@item Bid/Offer Column
The bid/offer column is normally shown as say @samp{2.10/2.12}, but when the
market is crossed (ie.@: bid higher than offer) an ``x'' is used to highlight
this, for example @samp{2.20x1.99}. What that means depends on the exchange,
it might be a pre-open auction, or merely transient.
@item Volume Column
Volume is abbreviated @samp{k} for thousands, @samp{m} for millions, @samp{b}
for billions. This is number of shares (or number of contracts), the same as
shown in the main chart.
@item When Column
The ``When'' column shows just a time for today, just the day for the past
week, or a full date prior to that. The timezone of the exchange is used. If
the exchange is in your local zone then there's no difference, but if you're
elsewhere then the exchange zone has the advantage that you can see where it
is in the trading session, eg.@: early on, the close, etc. It's easier to
remember opening and closing times at the exchange than local equivalents
(especially when daylight savings affects them).
@item Tooltip
Moving the mouse over an entry (and keeping it still) opens a tooltip box
showing the stock name (if available), full date/times for the quote and last
trade, and the exchange timezone location.
@end table
@c ---------------------------------------------------------------------------
@node Intraday, Download, Watchlist, Top
@chapter Intraday
@cindex Intraday
@cindex @key{Ctrl-I}
The View/Intraday menu entry (@key{Ctrl-I}) or the Intraday button in the
watchlist (@pxref{Watchlist}) opens an intraday image window for the current
symbol, showing trading today, or so-far today.
Alas there are no longer any data sources with intraday images.
@c are only
@c available from a few data sources (@pxref{Data Sources}).
@c @cindex @key{Alt-R}
@c The default display is 1-day, downloaded when the window is opened (then
@c cached). The option menu can select other timeframes such as 5-day, depending
@c on the data source. The underlined mnemonics ``5'' etc in the menu are
@c accelerator keys, eg.@: @key{Alt-5}. Click on Refresh (@key{Alt-R}) to update
@c as trading progresses through the day.
@c
@c Multiple intraday windows can be opened, or a new symbol entered in the text
@c box to view a different symbol (press @key{Return} or click the ``Enter''
@c button).
@c
@c To see the intraday for a symbol not in the database or watchlist just open an
@c intraday window for any symbol (or no symbol at all) then enter the desired
@c one.
@c ---------------------------------------------------------------------------
@node Download, Data Sources, Intraday, Top
@chapter Download
@cindex Download
@cindex Dialog, download
@cindex Tools/Download
The Tools/Download menu entry opens the download dialog. Choose ``What'' to
download, either all symbols, the favourites list, or a particular symbol.
@c Then choose ``When'' for the period to download, either an update of new
@c available data, or back to a given year (where possible).
The default is an update of all symbols. This is usually what's wanted, to
get all latest data.
Click on the ``Start'' button to begin. The top box is the subprocesses
running, the middle box is the jobs running or queued, and errors are shown in
the lower text window. If you're offline the errors will usually be ``host
name lookup failure'' or ``network unreachable''. To abort select the job in
the middle box and click on ``Stop''.
The main chart display can be used while downloading, for instance to look
immediately at the first few symbols updated while the rest are still going.
Sometimes a database update can make the GUI block for a moment.
@section Update Current Chart
@cindex Update data
@cindex @key{Ctrl-U}
In the main Chart window, @key{Ctrl-U} starts an update download for the
currently viewed chart. This is a good shortcut to grab new data for just one
symbol. Download progress is shown in the main window statusbar (as well as
the download dialog).
@section Download Automation
@cindex @command{cron}
@cindex Automation, download
You can run @samp{chart --download} to do a command-line (non-GUI) download
(@pxref{Invocation}), for instance in a script perhaps when first going
online, or at selected times. Progress messages are shown if the output is a
terminal.
Care should be taken not to hammer the various data sources when automating
downloads. Keep update attempts to times when there should be new data, and
don't retry endlessly.
( run in 0.518 second using v1.01-cache-2.11-cpan-e1769b4cff6 )