This manual describes how to install and use Chart, version 53.
Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Kevin Ryde
Chart is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version (see Copying).
Part I: Using Chart
Part II: Programming in Chart
Chart is a stock and commodity price charting program, featuring various display options, data downloading, and user extensibility.
Chart is written in Guile (see The Guile Reference Manual), and uses Gtk+ via the Guile Gtk 2.0 interface (see Guile Gtk). Extensions to Chart can be written using Guile. The home page is
http://www.geocities.com/user42_kevin/chart/index.html
Once you've installed Chart (see Installing), getting started is easy. Run chart, and choose File/Open from the menu bar. Enter a symbol, like ‘GM’ (for General Motors USA) and click “New”. The download dialog pops up and gets an initial 5 years data, then the chart is displayed.
The Watchlist is easy too (see Watchlist). Choose Tools/Watchlist from the menu bar, go to the Symbol box, enter a symbol like ‘NAB.AX’ (for National Australia Bank) and press <Return>. The symbol is added to the list and a latest quote downloaded. Click on “Refresh” to update.
Stock symbols broadly follow Yahoo Finance conventions, which is the exchange symbol plus a suffix, like ‘.L’ for the London Stock Exchange (see Yahoo Finance). But Chart is not Yahoo specific, other data sources have other suffixes, for example ‘GC.COMEX’ for COMEX gold (see Data Sources).
Chart is Free Software, published under the terms of the GNU General Public License (version 3 or later). The file COPYING contains the full license terms.
Chart is not in the public domain. It's copyrighted and there are restrictions on its distribution and redistribution, but these restrictions are designed to permit everything a cooperating person would want to do.
Essentially you can give or sell copies to anyone, with or without modifications, but you must allow everyone else to do the same and you must clearly identify any modifications.
Be aware there is no warranty whatsoever for Chart. This is described in full in the license terms. No warranty whatsoever includes no warranty against any losses or missed gains as a result of anything Chart does or doesn't do or show.
Note that Chart is only a program for displaying data. It should be clear that this manual and the program itself do not give financial advice.
The data that Chart may download or display will be copyrighted by the creator of that data and will be provided under terms decided by the creator. You must check each data source used to see that you and your intended use are within the terms (see Data Sources). The minimum for a source in Chart is that personal non-commercial use is permitted (and no re-distribution usually).
The author believes that the manipulations Chart performs on downloaded data are purely mechanical and do not cause the program's terms to be added to any results. Derived forms like the database files, watchlist quotes, screenshots of graphs, etc, will be subject only to the conditions of the data originator(s).
The following programs and libraries are required, see their respective documentation for installation instructions.
Chart uses an Autoconf (see Autoconf) and Automake (see GNU Automake) based configuration system. A basic build and install can be made as follows. This will install under ‘/usr/local’.
./configure make make install
The usual configure options and build targets are available. Run ‘./configure --help’ for a summary of the options.
Here are some Chart-specific notes and build options,
The --with-zlib option directs Chart to use Zlib, or not. The
default is ‘detect’ which means to use it if available. Zlib must be
installed before Chart is configured, but the gzip program can be
installed later because it's detected when Chart runs.
https
secure
HTTP (see London Metal Exchange, see MLC Funds).
The --with-gnutls option directs Chart to use GnuTLS, or not. The
default is ‘detect’ which means to use it if available. GnuTLS must be
installed before Chart is configured, but the openssl program can be
installed later because it's detected when Chart runs.
float.com.au
but not mandatory there (see Float).
iconv()
The X/Open standard iconv()
character conversion functions are used by
Chart, when available, to handle various character sets
(see Internationalization).
If you're only using English and plain ASCII then iconv
is not
required, but if you want to see or enter other characters then you must have
it. On a GNU system iconv
is built into the C library. On other
systems if you don't already have it then you can install GNU libiconv
(see References).
$prefix/share/gnome/help/chart/C/chart.html
and it can be viewed with or without Gnome using Help/Manual within Chart. Or
of course with any external browser too.
Info format chart.info and HTML chart.html (per above) are included in the distribution. Info can be read with Emacs (see Other Help Commands) or a stand-alone info reader such as the Texinfo one (see GNU Info).
The usual Automake targets are available to make PostScript chart.ps, PDF chart.pdf and DVI chart.dvi. These will require various TeX and Texinfo tools. DocBook and XML can be generated by makeinfo too (see Options for makeinfo).
A Scrollkeeper OMF entry is installed for the manual (the HTML form), for use by Gnome help (Yelp), or similar packages.
chart [--options] [symbol...]
The default is to run the Gtk graphical interface. The optional symbol is an initial symbol to display.
symbol can be a partial name, it's matched against the database the same
way as in the Open dialog (see Open). So if TSCO.L
is the only
thing in the database starting with “TS” then just ‘chart ts’ is
enough, or similarly for ^GSPC
just ‘chart gsp’ may be enough.
The graphical options are
--display is a standard Gtk option, other standard Gtk options are accepted too, but there's none that do much for Chart. See man 7 gtk-options for a full list.
Chart can also do data downloading from the command line. Error messages are printed to the standard output, plus progress messages if it's a terminal. This is good for a cron job or other automated update. The usual way to update everything is
chart --download --all
The options are
Shell style wildcards ‘*’ and ‘?’ can be used to match existing database symbols. ‘*’ matches any sequence of characters, ‘?’ matches any single character. For example to update all Australian shares
chart --download '*.AX'
The quotes ‘'...'’ are only to stop the ‘*’ from being interpreted by the shell, see Quoting.
Other options are,
Chart includes some support for the GNU Bash command line completion features (see Letting Readline Type For You). The script
$prefix/share/chart/chart.bash
will let you hit <Tab> etc to complete symbols entered on the command line. For example type ‘chart --download bh’ <Tab> could complete to ‘BHP.AX’. Options are completed too, so ‘chart --do’ <Tab> gives ‘--download’.
To load this, source the file from your .bashrc (see Bash Startup Files). See comments in chart.bash for
more, including use with the bash_completion
project
(see References).
There are four symbol lists in Chart,
The favourites list is the default shown in the watchlist (see Watchlist) and is intended for symbols which you're interested in at the moment. Symbols don't have to be in the database, they can be in the list just to see quotes in the watchlist.
Symbols can be added or removed using the watchlist dialog, and from the main window (see Main Window) when viewing a chart using the File menu entries (accelerators <!> and <Control-!>). Entries can be moved around from the watchlist too.
The alerts list is symbols which have gone above or below alert level annotations that you set (see Annotations). This is dynamically generated, based on the latest quote or database price available, and of course if you change an alert level then the symbol is added or removed accordingly.
When a stock has been delisted or a futures contract has expired, the symbol is put into the historical list. The current rule is to go when there's no new data for 3 weeks, or 3 weeks after a known contract expiry date.
“No new data” doesn't merely mean no trades, it means no new information at all from the data source for that time. Current data sources don't give direct indications of stocks that have been delisted, the rule here is designed to pick them up yet not catch stocks merely suspended for a period.
The historical list cannot be directly edited, but if a stock has been re-listed it can be lifted out of historical status by explicitly downloading. (Do an <Ctrl-U> update, or ask for that symbol in the download dialog, see Download.)
The all list is all symbols in the database, except those in the historical list described above.
The File/Open dialog selects a symbol to display. Click on an entry in the tree, or type in a symbol. Upper or lower case can be entered, and just some of the symbol – the tree selection jumps to show what's matched. There's no need to give the suffix, unless two symbols are the same apart from the suffix.
The tree shows the various symbol lists (see Symbol Lists), but for the favourites list only symbols actually in the database. Clicking on an entry makes that list current, so <N> and <P> then navigate within that. Initially the start of the tree is current, so <N> starts in the Alerts list.
To add a new symbol, enter it and click “New” (<Alt-N>). In this case you must have upper/lower case and the suffix correct. There's no validation for that, you just have to be careful. An initial download is done and the chart is displayed.
When adding a lot of new symbols the command line download (see Invocation) 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,
chart --download TSCO.L RNO.PA TEL.NZ BMW.DE
The default display is daily open/high/low/close bars with volume below. <Ctrl-W> selects a weekly display, or <Ctrl-M> monthly. <Ctrl-D> goes back to daily.
The scroll bars move the visible portion. Arrow keys <Up>, <Down>, etc move by a step, or control-arrows and <Page-Up>/<Page-Down> move by a page. Mouse <Button-1> drags the graph within the window. <Ctrl-C> centres it vertically in the window, if you lose track when paging around.
<Z> and <Shift-Z> zoom in and out vertically. <W> and <Shift-W> zoom in and out horizontally (‘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.
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
| | +-- | +----- | +-- | --+ | |
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.
The Edit/Viewstyle dialog has options for the line style (OHLC, candles, etc), whether to adjust for stock splits (default yes), dividends (default no), and futures rollovers (default yes), and selections to enable various indicators.
Candlestick figures are shown in green for close above the open, or red for close below the open. This is instead of traditional hollow and solid, because hollow is hard to see when zoomed out to fit maximum data on the screen. If there's no opening prices, candlesticks fallback to OHLC figures (just high/low and close). If there's no high/low either, then candlesticks, OHLC and HL styles all fall back to a plain line.
Various averages (see Averages) or channels (see Channels and Boxes) can be applied in the main window, and an indicator (see Indicators) and an average (on it) in the lower window. The indicators have various parameters, like smoothing periods. For some closely related indicators the parameters are shared (eg. ADX and DMI), but most are independent for ease of tuning. The “Info” button at the right opens this manual at the selected indicator's description.
<Shift-Button-3> (ie. mouse <Button-3> while the <Shift> key is held down) pops up a quick menu to change the indicator. On a two-button mouse <Button-3> is usually the right button. The menu has a tearoff to keep it open for quick selection too. But parameter values can only be set from the Edit/Viewstyle dialog.
There's just one global view style, applied to all charts viewed.
Dividends and stock splits are shown across the top of the chart at ex dates. Both are part of normal data downloading, but may not be available for all exchanges or all stocks, and might have only recent or upcoming dividends (not historical dividends).
Prices drawn in the graphs are adjusted for splits, bringing past prices to the same capital basis as current prices. Dividends can be adjusted similarly, possibly with imputation credits (Australia and New Zealand) included. These adjustments are controlled from the Edit/Viewstyle dialog (see View Style).
Dividend adjustments are made using a multiplier factor based on the dividend amount and the last close before going ex-dividend. This is like a “dividend reinvestment” plan or an accumulation style share index.
For “front month” futures symbols (the commodity alone like ‘GC.COMEX’), the rollover to each new contract is recorded in the dividends. Normally the next contract is a higher price (representing a cost of carry) and the extra amount is treated like a kind of reverse dividend, an extra amount to pay to keep a long position. With rollover adjustment (the default) the front month is therefore as if reinvesting in the next month on each expiry day.
The Edit/Dividends menu entry opens the dividends dialog to manually add or amend entries, or just to see the full list. Be warned that the data download will consider it knows best and will overwrite an entry it has information about. Annotations should be used for a personal reminder etc (see Annotations). Currently there's nothing specific for capital returns, the suggestion is to enter them manually as dividends (no data sources get this information automatically).
Dividend amounts can be recorded as free-form strings and certain special cases like “to be advised” instead of numbers. Splits are always recorded as numbers. When editing, the forms like the following are generated and recognised,
unknown to-be-advised 12.5 estimated 12.5 split 5 for 4 month: Jan 2007
The words here like ‘to-be-advised’ are in the selected language where possible (see Internationalization), but for ease of use are always recognised in English too.
The cross is an orange horizontal and vertical line drawn following the mouse. It's designed to help show relative price levels, or to see down to the time scale. The date and price are shown in the status area at the bottom too.
The cross can be toggled with the <C> key, or from the Tools/Cross menu entry. It can also be enabled just temporarily by pressing and holding mouse <Button-3>. On a 2-button mouse <Button-3> is usually the right button.
The ticker scrolls prices along a line at the bottom of the screen, refreshed periodically. It's selected in the main window from the Tools/Ticker menu, or can be run standalone with the --ticker command line option (see Invocation).
Mouse <Button-1> drags the text back and forward, if you miss something, or want to hurry it up. <Button-3> pops up a menu to pause, force a refresh, or close it. On a 2-button mouse <Button-3> is usually the right button. Prices are automatically refreshed every 5 minutes, while running and visible.
The default is to show the favourites list (see Symbol Lists), but that can be changed from the menu. When standalone a symbol list or specified symbols can be given on the command line. For example to see everything in the database ‘chart --ticker --all’.
Annotations can be added to a chart, in the form of notes for particular days, and lines drawn on the chart. Both are private to each user.
Text notes can be added with the Edit/Annotations dialog. These are free-form and can be used as reminders about particular events.
Lines can be drawn on a chart to show apparent trends or support/resistance etc. Lines can be drawn anywhere desired, and are stored using date and price so they scale with the display.
To draw a line, press and hold mouse <Button-2> at the start, and drag to the end. On a 2-button mouse <Button-2> usually means pressing both buttons at the same time.
While drawing, press <H> to toggle between a sloping line (the default) and a horizontal line. A line can be moved by pressing and dragging <Button-2> near an endpoint. Press <Escape> to abort an edit. To delete a line, press <D> while moving it.
Alert levels put a symbol into the Alerts list when the last price (or bid/offer) is above or below a selected price.
Alert levels are edited like lines above. While editing, press <A> to switch to an alert, and then <A> again to toggle between an alert above (the default) or below the level.
When an indicator or average is based on a some number of past days, only trading days are counted, so for instance 10 days is 2 weeks. Days with no trading (public holiday, trading halt, etc) are skipped too.
At the start of data (the initial listing, or just the start of what's been downloaded), a “75% weight” rule is applied so that an indicator or average begins once there's enough data for 75% of the weighting in its calculation. For example a 20 day simple moving average starts when there's 15 days data, it doesn't wait for the full 20.
Of the following averages, the simple moving average and exponential moving average are the best known.
By default the averages are applied to closing prices, but this can be changed (in the Edit/Viewstyle dialog) to instead opens, highs, lows, midpoint (H+L)/2, typical price (H+L+C)/3, or weighted close (H+L+2*C)/4.
An N-day simple moving average is the unweighted average (mean) of the past N days. So if p1 is today's closing price, p2 yesterday's, etc, then the SMA for today is
p1 + p2 + ... + pN SMA = ------------------ N
Because old prices have the same weighting in the average as recent prices, the SMA can be rising merely because old lower prices are dropping out of the window. The weighting of past days also makes it seem to lag behind recent action. The EMA (see Exponential Moving Average) and WMA (see Weighted Moving Average) approaches address that sort of lag.
See also Momentum and Rate of Change, which show the slope of the SMA.
An N-day exponential moving average (EMA) is a weighted average of today's close and the preceding EMA value. The weight for today's close is a smoothing factor alpha, where alpha=2/(N+1).
EMA[today] = alpha * close + (1-alpha) * EMA[yesterday]
The formula can also be written as follows, showing how the average moves towards today's close by an alpha fraction of the distance from the old EMA to the new close.
EMA[today] = EMA[yesterday] + alpha * (close + EMA[yesterday])
Expanding out gives a power series with successively decreasing weight for each day's price. Writing f=1-alpha and with p1 today's closing price, p2 yesterday's, etc, then
p1 + p2*f + p3*(f^2) + p4*(f^3) + ... EMA = ------------------------------------- 1 + f + f^2 + f^3 + ...
This is an infinite sum, but f is less than 1 so each successive weight f^k is smaller and smaller, soon becoming negligible. The most recent N days make up about 86.5% of the total. The following graph shows how the weights decrease for N=10.
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 Simple Moving Average).
When working with N-day periods, it should be noted that J. Welles Wilder uses a different reckoning of the decrease factor for EMAs. For example for a 14-day EMA he writes
1 13 EMA[today] = -- * close + -- * EMA[yesterday] 14 14
This is the same as the formula above, just a different f factor. When Wilder gives “W” days, the equivalent “N” above is 2*W-1, so say 14 becomes 27. This is also sometimes called a “modified moving average”.
In the indicators designed by Wilder, Chart uses his reckoning, so that for instance a 14-day RSI is entered at 14. This applies to ATR, DMI (and ADX) and RSI (see Average True Range, Directional Movement Index, and Relative Strength Index).
An N-day weighted moving average is an average of today's close and preceding closes, with weighting factor N for today, N-1 for yesterday, N-2 for the day before, etc. The influence of past data thereby decreases with its age, down to nothing beyond N days.
The formula is as follows, with p1 for today's closing price, p2 yesterday's, etc.
N * p1 + (N-1) * p2 + (N-2) * p3 + ... + 2 * p[N-1] + pN WMA = -------------------------------------------------------- N + N-1 + N-2 + ... + 2 + 1
Like the EMA (see Exponential Moving Average), 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 Simple Moving Average). The following graph shows how the weights decrease for N=15.
The double exponential moving average (DEMA) and triple exponential moving average (TEMA) are combination EMAs (see Exponential Moving Average) by Patrick Mulloy, designed to track recent prices even more closely than the plain EMA. The calculation for DEMA is
DEMA = 2*EMA[N] - EMAofEMA[N]
and for TEMA,
TEMA = 3*EMA[N] - 3*EMAofEMA[N] + EMAofEMAofEMA[N]
Both are “overweight” 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 N=15.
And the following is TEMA for the same N=15.
The endpoint moving average (EPMA) establishes an average price by fitting a least squares straight line (see 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 2*N-1 down to -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 p1 is today's close, p2 yesterdays, etc, then
(2*N-1)*p[1] + (2*N-4)*p[2] + ... + (-N+2)*p[N] EPMA = ----------------------------------------------- 2*N-1 + 2*N-4 + ... + -N+2
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 N=15.
The negatives mean the average is “overweight” 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.
It's interesting to compare the EPMA with a plain SMA (see Simple Moving Average). An SMA effectively draws a horizontal line through the past N days prices (their mean), whereas the EPMA draws a sloping line.
The inertia indicator (see Relative Volatility Index) uses the EPMA.
http://www.mesasoftware.com/technicalpapers.htm
The fractal adaptive moving average (FRAMA) by John Ehlers is an exponential style moving average (see Exponential Moving Average) with an alpha smoothing factor that varies according to a fractal dimension calculated over the past N day's prices.
The dimension is calculated by looking at the N days in two halves, the immediately preceding N/2 days and the N/2 preceding that. The trading ranges in those halves are compared to the total range and an alpha factor for the EMA generated. The calculation is slightly tricky but in essence the amount of overlap between the ranges is measured. The alpha factor is small, and the EMA slow, when the halves overlap. The alpha is large, and the EMA fast, when the halves don't overlap but add up to make the overall N day range.
The FRAMA alpha factor and the fractal dimension value are available in the lower indicator window, to see where they're big or small. These are low priority options, near then end of the indicators lists.
http://www.guppytraders.com/gup329.shtml
http://www.chartfilter.com/articles/movingaverage.htm
The Guppy multiple moving average (GMMA) by Darryl Guppy is a set of six short term and six long term exponential moving averages (see 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.
http://www.alanhull.com.au/hma/hma.html
The Hull moving average (HMA) by Alan Hull is a combination of weighted moving averages (see Weighted Moving Average) with a momentum component, designed to have low lag.
HMA = WMA[floor(sqrt(N))] of (2 * WMA[floor(N/2)] - WMA[N])
The average is weighted towards recent prices, and in fact has negative weights for prices past about N/2 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 N=15.
The Kaufman adaptive moving average (KAMA) by Perry J. Kaufman (http://www.perrykaufman.com) is an exponential style average (see Exponential Moving Average) but with a smoothing that varies according to recent data. In a steadily progressing move the latest prices are tracked closely, but when going back and forward with little direction the latest prices are given only small weights.
The smoothing factor is determined based on a given past N days (default 10). The net change (up or down) over that time is expressed as a fraction of the total daily changes (up and down). This is called the “efficiency ratio”. If every day goes in the same direction then the two amounts are the same and the ratio is 1. But in the usual case where prices backtrack to some extent then the net will be smaller than the total. The ratio is 0 if no net change at all.
abs (close[today] - close[N days ago]) ER = -------------------------------------- Sum abs (close - close[prev]) past N days
The ER is rescaled to between 0.0645 and 0.666 and then squared to give an alpha factor for the EMA of between 0.444 and 0.00416. This corresponds to EMA periods from a fast 3.5 days to a very slow 479.5 days.
alpha = (ER * 0.6015 + 0.0645) ^ 2
An exponential moving average of prices is then taken, using each alpha value calculated.
KAMA = alpha * close + (1-alpha) * KAMA[prev]
These alpha values can be viewed directly with “KAMA alpha” in the lower indicator window (a low priority option, near the end of the lists). High values show where KAMA is tracking recent prices closely, low values show where it's responding only slowly.
http://www.mesasoftware.com/technicalpapers.htm
http://www.mesasoftware.com/Papers/Time%20Warp%20Without%20Space%20Travel.exe (Zip file)
The Laguerre Filter by John Elhers is a smoothing filter based on Laguerre polynomials. Its first term is an EMA (see Exponential Moving Average), 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 almost exactly follow prices, down to 0 for a very slow response.
The result is still a weighted average of past prices. The weights for example for the default alpha=0.2 are as follows.
The adaptive laguerre filter is a variation on the laguerre filter using a variable alpha factor, 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.
The raw alpha values can be viewed as “Adaptive Laguerre Alpha” in the lower indicator window (a low priority option, near the end of the lists). High values mean closely tracking prices, low values mean only slow response.
http://www.mesasoftware.com/technicalpapers.htm
http://www.mesasoftware.com/Papers/What%27s%20the%20Difference.exe (Zip file)
The median-average adaptive filter by John Elhers is an EMA (see Exponential Moving Average) with an alpha smoothing factor that varies according to how close it is to a median.
The raw alpha values can be viewed as “Median-Average Alpha” in the lower indicator window (a low priority option, near the end of the lists). High values are where the average is following recent prices closely. The maximum is 0.5, which corresponds to a 3-day EMA.
The moving median is simply the median of the past N days' closing prices. This may be of limited interest and is thus a low priority option, shown near the end of the indicator lists.
For reference, a median is calculated by considering the prices sorted from highest to lowest. The middle one is the median, or if there's an even number then the mean of the middle two. So for example with 15 points the chosen median point will have 7 others above it and 7 below it. The effect when plotted is a line that stays roughly in the middle of the past N days price action.
The regularized exponential moving average (REMA) by Chris Satchwell is a variation on the EMA (see Exponential Moving Average) designed to be smoother but not introduce too much extra lag. The formula can be given in a number of forms, such as
Rp + alpha*(close - Rp) + lambda*(Rp + (Rp-Rpp)) REMA = --------------------------------------------- 1 + lambda
where alpha is the N-day smoothing as per an EMA; Rp is yesterday's REMA; and Rpp is the day before. Lambda is a factor controlling the amount of “regularization”.
This form shows how there's an Rp+alpha*(close-Rp) part like an EMA, and an Rp+(Rp-Rpp) part which projects from yesterday's REMA according to whether it was rising or falling relative to the day before. The two parts are averaged with a weighting 1 for the EMA part and lambda for the projection.
If lambda is zero then REMA is the same as a plain EMA. Satchwell suggests fairly small values for lambda, and the default in Chart is 0.5. John Ehlers noted that if lambda is large REMA becomes unstable.
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 N=15 and lambda=0.5,
A sine weighted moving average (SWMA) applies weights to each day in the shape of the bulge in a sine curve from 0 to pi. For an N-day average the weightings are
/ 1 \ / 2 \ / N \ sin | --- * pi |, sin | --- * pi |, ..., sin | --- * pi | \ N+1 / \ N+1 / \ N+1 /
The effect is that middle prices have the greatest weight (much like the TMA, Triangular Moving Average). The graph below shows the weights for N=10. In Chart SWMA is a low priority option, shown near the end of the averages lists.
The T3 moving average by Tim Tillson is a triple smoothed combination of the DEMA (see Double and Triple Exponential Moving Average) and a plain EMA (see Exponential Moving Average).
A given “volume factor” V (default 0.7) controls how much of the DEMA is used. The factor ranges from 0 which gives a plain EMA, up to 1 which gives a full DEMA. Values in between are a combination. The formula for this “generalized DEMA” is
GD(N,v) = (1-v)*EMA[N] + v*DEMA[N]
or equivalently as follows, emphasising how a portion of the momentum term present in the DEMA is used,
GD(N,v) = EMA[N] + v * (EMA[N] - EMAofEMA[N])
T3 applies this three times,
T3(N,v) = GD(N,v) of GD(N,v) of GD(N,v)
The following graph shows the weightings that result from N=10 and v=0.7.
At the lower v=0 extreme T3 is simply an EMA of EMA of EMA, See EMA of EMA of EMA. At the upper v=1 extreme T3 is a DEMA of DEMA of DEMA, and the following is the weights for that (again N=10),
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.
It's interesting to note TMA is equivalent to a twice-smoothed simple moving average of half period (see Simple Moving Average).
TMA[N] = SMA[floor(N/2)+1] of SMA[ceil(N/2)]
In Chart TMA is a low priority option, shown near the end of the averages lists.
The variable index dynamic average (VIDYA) by Tushar Chande and Stanley Kroll1 is an exponential style moving average (see Exponential Moving Average) with a smoothing that varies according to recent price volatility.
A volatility measure is obtained by taking the standard deviation (stddev, see Standard Deviation) of the past 9 days closing prices, expressed as a fraction of a longer stddev of 30 days. A scaling factor of 0.2 produces an alpha usually in the range of about 0.3 to 0.1, corresponding to EMA periods of about 5 to 20 days.
stddev[short] of closing prices alpha = 0.2 * ------------------------------- stddev[long] of closing prices
An exponential moving average of prices is then formed in the usual way, with each day's alpha.
VIDYA = alpha * close + (1-alpha) * VIDYA[prev]
The alpha values can be viewed directly with “VIDYA alpha” in the lower indicator window (a low priority option, near the end of the lists). High values show where the VIDYA is tracking recent prices closely, low values show where it's responding only slowly.
An N-day volume weighted moving average (VWMA) is the average of the past N days closing prices, each weighted in proportion to the volume on that day. So if p1 is today's closing price, p2 yesterday's, etc, and v1, v2, etc similarly the volumes, then the VWMA for today is
v1 * p1 + v2 * p2 + ... + vN * pN VWMA = --------------------------------- v1 + v2 + ... + vN
The effect is to give greater significance to days with greater volume, making the average tend towards those days' closing prices more. If all volumes are about the same then the VWMA becomes a simple moving average (see Simple Moving Average).
A true VWMA, the kind frequently specified for dividend reinvestment plans and other things needing an average price around a particular period, takes every price level and the volume transacted at that level. Chart doesn't have the data needed for that and the calculation above instead effectively attributes all volume to the closing price.
The zero-lag exponential moving average (ZLEMA) is a variation of the EMA (see Exponential Moving Average) which adds a momentum term aiming to reduce lag in the average in order to track current prices more closely. For a given N-day period the formula is
ZLEMA = EMA of (close + (close-close[lag]))
Where the “lag” period is (N-1)/2. A plain EMA, applied to straight line points, ends up always being the close at (N-1)/2 days ago. So the idea of adding in this difference “close - close[lag]” is to compensate for that lag, so the ZLEMA tracks a straight line exactly. Of course real data is rarely a straight line, but the principle is to push the ZLEMA towards approximately the current close.
The calculation still ends up as various weights on each past price. The effect of the momentum term is to make recent prices “over weight” and thus tracked closely, and with negative weights on past terms. There's a sudden jump in the weights at the momentum lag point. For example the following graph is the weights for N=15 (lag point 7).
The EMA lag on a straight line can be calculated easily using the power formula for the EMA (see Exponential Moving Average), 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 (N-1)/2, but will vary according to shape, period of cyclical components, etc.
Bollinger bands by John Bollinger are an N-day simple moving average (see Simple Moving Average) with an upper and lower line drawn at 1 standard deviation away from the average (the distance multiple is configurable).
Standard deviation (see Standard Deviation) is a statistical measure of how much the values in a data set (the N closing prices in this case) deviate from their average (mean). When prices are not changing much the deviation is small and the band lines are close to the average. The bands are further away when closing prices are more volatile.
See also Kirshenbaum Bands, which are similar but with a channel width based on standard error from a linear regression.
Darvas boxes by Nicholas Darvas are a system of drawing boxes on certain trading ranges, with a view to trading breakouts up or down from them.
The top of a box is formed when the high of day 1 is not penetrated on the immediately following day 2 and day 3. The bottom of the box is established similarly when a low is not penetrated on two subsequent days. The first candidate low is the low of day 3, and the search for a low can extend indefinitely. If the box top is penetrated while looking for the low then the box is abandoned.
Boxes in Chart are drawn without sides, just as top and bottom, so as not to obscure the price plot. The starting point for box finding is the start of all data in the database, so as to attempt to make the results consistent, though it's still not deterministic in the worst case, since one can never be sure if there's a bigger enclosing box back in past data.
The Donchian Channel by Richard Donchian is a simple band system showing an N-day highest high, N-day lowest low, and a midpoint line between them.
The N days start from yesterday, so a day which is a new N-day high or N-day low will break out of the channel and this is taken as a bullish or bearish signal (respectively).
Kirshenbaum bands are channel lines drawn around an exponential moving average (see Exponential Moving Average). The channel width is a multiple of the “standard error” from a linear regression of a past N days (see Linear Regression, and the EMA is smoothed using the same N days.
Kirshenbaum bands are similar to Bollinger bands (see Bollinger Bands), but with a linear regression standard error (stderr) instead of a standard deviation (stddev, see Standard Deviation). The difference is that stddev takes no account of a trend, so the Bollinger channel widens when a trend is in progress. But stderr is based on deviation from a fitted sloping line, so if prices are making consistent steady progress up or down the channel width remains small.
The standard error values (ie. the channel width) can be viewed directly as an indicator too with “Standard Error” (see Linear Regression).
Ichimoku kinko hyo by journalist Goichi Hosoda (writing under the pseudonym “Ichimoku Sanjin” the 1930s) is a set of indicator lines designed to show the overall state of the market. The name means roughly “chart equilibrium at a glance” in Japanese.
The cloud adds to the bullishness or bearishness of the tenkan/kijun
crossovers. A bullish cross while above the cloud is a strong buy signal,
whereas within the cloud it's only a normal buy, or below the cloud a weak
buy. Conversely a bearish cross is a strong sell if below the cloud, normal
within, or weak if above. The cloud region beyond current data is also
interpreted as prospective future support/resistance.
The time periods of 9 days and 26 days are parameters in Chart (see View Style). When Hosoda designed the system Japanese markets traded 6 days a week, so 9 days was 1 1/2 trading weeks and 26 days was a month. The same calendar times in today's 5 day weeks can be had with 7 and 22 days.
The Keltner channel is an N-day simple moving average (see Simple Moving Average) of “typical price” (which is (high+low+close)/3), and bands drawn above and below that at a distance which is the simple moving average of daily ranges (high to low) in the period.
This indicator was described by Chester W. Keltner in his 1960 book How To Make Money in Commodities, and those who learnt of it from him apparently gave it the name Keltner Channel. Keltner himself called it the “Ten-Day Moving Average Trading Rule” and never claimed any originality for the idea – it may have come from grain traders in the 1930s, or even earlier.
The idea is that closes outside the channel suggest strong bullish (or strong bearish) sentiment and can be bought (or sold). The 10-day period is a parameter in Chart.
The channel bands need daily high/low data, so when that's not available (a few indexes for instance) they can't be drawn. The centre line is still shown (it ends up as just a simple moving average of the closes).
Parabolic stop and reverse (SAR) by J. Welles Wilder is a trend following system which establishes a trailing stop that's progressively advanced as the move continues. If penetrated then one's position short or long is reversed and a new stop established for the move in the opposite direction.
The stop is calculated as follows. For an upward move, the initial SAR is the lowest low made in the preceding down movement. From there an extreme high of the current move is maintained and the stop advances towards that by a fraction called the “acceleration factor”.
SAR = SAR[prev] + accel * (extreme - SAR[prev])
The initial acceleration factor is 0.02, and each time a new extreme is made, ie. a new high, it's increased by adding 0.02, up to a maximum of 0.2. (Those values are parameters in Chart.) The effect is to move the stop up faster in a strong move making successive new highs.
If the SAR for a given day is penetrated by any part of that day's trading range, it's a signal to reverse one's position and the SAR then becomes a trailing stop for a short. The calculation for that is the same, using the previous extreme high as the initial stop, then maintaining a low to step towards. Reversals can be seen in the graph when the stop mark switches from above to below the prices, or back.
This approach is only suited to trending markets. If prices are chopping back and forward in a ranging market then a lot of whipsaw reversals tend to be generated. At each reversal the new stop point can be quite a distance from the current prices (ie. one's entry point), making those whipsaws expensive. Wilder believes markets trend only about 30% of the time, his ADX (see Directional Movement Index) is one way to identify such conditions.
In Chart the default is not to adjust for dividend payments in the display or in indicator calculations. If price falls on ex-dividend dates are causing unwarranted SAR reversals you can turn on the adjustment option in the view style (see View Style). (Assuming the data source provides dividend information.)
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 c, h, l, v and with ADprev as yesterday's Acc/Dist the formula is
C - L AD = ADprev + V * (2 * ----- - 1) H - L
When the close is at the high the factor is +1 and the full volume is added in, when the close is at the low the factor is -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 +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 (see 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 Chaikin Money Flow.
The accumulative swing index (ASI) by J. Welles Wilder forms a cumulative total of certain swing index values, those being 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 for each commodity, but this is not done in Chart. The shape of the resulting curve is not changed by that.
The raw swing index values can be viewed with the “Swing Index” indicator (a low priority option near the end of the indicator lists, because it's of little direct use).
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,
AroonOsc = AroonUp - AroonDown
In Chart the Up line is drawn in green, the down in red, and the oscillator in white.
Average true range (ATR) by J. Welles Wilder is the daily “true range” values (see True Range) smoothed by an N-period exponential moving average (see Exponential Moving Average).
ATR = EMA[N] of True Range
The default smoothing period is 14 days, as recommended by Wilder. The period is always by Wilder's reckoning of EMA smoothing period (see Wilder EMA period).
The idea behind ATR is that when traders are enthusiastic, either in an uptrend or downtrend, the range will be higher as the stock or commodity is bid up or sold down through the day. A lesser range suggests waning interest.
When a data source doesn't provide high/low values (some indexes for instance), then just close-to-close changes are used. This may be of limited use.
The normalized ATR by John Forman (http://www.theessentialsoftrading.com) expresses the ATR as a percentage of the current closing price. This makes it possible to compare ATR values over long periods where a share price level (and hence the typical daily ranges) have changed greatly.
ATR NATR = 100 * ----- close
http://www.mesasoftware.com/technicalpapers.htm
http://www.mesasoftware.com/Papers/The%20CG%20Oscillator.exe (Zip file)
The Centre of Gravity (CG) oscillator by John Ehlers is a comparison of recent prices against older prices within a given past N days.
Prices from those N days are imagined as weights placed on a beam, equally spaced, and the CG oscillator is then the balance point or centre of gravity along that beam. The prices used are the midpoint of each day's high/low. If p1 is today's price, p2 yesterday's, etc, then the formula is
1*p[1] + 2*p[2] + ... + N*p[N] CG = - ------------------------------ p[1] + p[2] + ... + p[N]
The “-” sign puts the CG on a scale of -N at the oldest end, up to -1 at the newest prices end. But those extremes are not reached, instead CG hovers around the midpoint -(N-1)/2. The scale is not important, only the shape of the curve, which rises if recent prices are higher, and falls if recent prices are lower.
Ehlers suggests looking at a past 10 days, and that's the default. He notes that if N is very small the CG becomes quite noisy, and that if N is large it tends to become very unresponsive.
The Chaikin money flow index by Marc Chaikin is based on the Accumulation/Distribution index calculations (see Accumulation/Distribution), but just within a past N-day window. The formula is
/ close - low \ total N-day volume * | 2 * ----------- - 1 | \ high - low / Chaikin MF = ------------------------------------------------ total N-day volume
The Acc/Dist style volume values in the numerator range between +volume and -volume according to “closing location value”. They're summed and expressed as a fraction of the total volume in that period. This fraction therefore ranges from -1 to +1, but in practice the extremes are rarely reached (since it would require every day to be a close at the day's high to get +1, or every day at the low to get -1).
The idea is that buying strength is indicated by a close near the top of the day's range, suggesting buyers have bid it up through to course of the day or recovered from pullbacks. Conversely a close near the bottom of the range suggests sellers in control. The amount of volume this is done on is worked in, as a measure of the significance of the action. In any case positive values are bullish and negative values are bearish in this interpretation, though with perhaps with large values representing extremes which are likely to reverse.
This Chaikin money flow is is similar to the plain money flow index (see Money Flow Index), but the latter uses close-to-close up or down, where Chaikin uses close within the day's range as a fraction, not just an “all or nothing” up or down.
High/low and volume data are required before Chaikin money flow can be drawn, this may not be available for some data sources (some stock indexes in particular).
It should be noted that “money flow” here is a shorthand for the enthusiasm of buyers (or, when negative, sellers). It's common to speak informally of money flowing into or out of a stock, but of course there's never actually any net money in or out (since for every buyer there's a seller of the same amount).
The Chaikin oscillator, or Chaikin A/D oscillator, by Marc Chaikin is simply the difference between a 3-day and 10-day exponential moving average (EMA, see Exponential Moving Average) of the Accumulation/Distribution index (see Accumulation/Distribution).
Chaikin Osc = EMA[3] of A/D - EMA[10] of A/D
The periods 3 and 10 are configurable.
The Commodity Channel Index by Donald Lambert is an oscillator designed to identify overbought and oversold conditions in a ranging market. It expresses the difference between today's typical price and a recent average as a fraction of each day's mean deviation from that average.
tp[today] - avg CCI = --------------- 0.015 * meandev
“Typical price” is the average of high, low and close. Chart uses just the close if there's no high/low data from a particular data source.
high + low + close tp = ------------------ 3
The average typical price is the simple moving average of the past N days.
tp1 + tp2 + ... tpN avg = ------------------- N
The mean deviation is the difference between each day's typical price and the average, taken as absolute values (ie. ignoring negative signs), averaged over the N days,
abs(tp1 - avg) + abs(tp2 - avg) + ... abs(tpN - avg) meandev = --------------------------------------------------- N
The scaling factor 0.015 above is designed to put the index between +100 and -100 roughly 70% to 80% of the time. Those levels are drawn as dashed lines. Lambert regarded index values outside that range as overbought or oversold, but with no actual buy or sell signal until crossed back, ie. rising above +100 then coming back below that, or conversely falling below -100 then rising back above it again.
The default N-day period in Chart is 20 days. Lambert recommended making it about 1/3 of the market cycle, so 20 days would correspond to a 60 day cycle.
The Coppock Curve, or Coppock Indicator, by Edwin Coppock2 is a smoothed rate of change style indicator designed to identify long-term buy signals on a monthly chart.
The indicator is calculated as the sum of 14-period and 11-period ROC values (see Momentum and Rate of Change), smoothed with a 10-period WMA (see Weighted Moving Average). Adding the two ROCs has the effect of averaging their values.
Coppock = WMA[10] of (ROC[14] + ROC[11])
Coppock designed the indicator for use on a monthly time scale, which can be viewed in Chart with <Ctrl-M> (see Main Window). In other timebases (days or weeks) Chart uses the same 14, 11 and 10 periods, which may or may not be useful, since months were what Coppock intended.
The indicator generates a buy signal for long-term investors when it's below zero and turns upwards from a trough. The nature of the calculation means this will be well after the low in prices, the signal is meant to indicate a good rally has been established.
The detrended price oscillator (DPO) aims to eliminate an intermediate or long term trend and show variations around that trend. It's calculated on a given N days using today's close and a past simple moving average (see Simple Moving Average),
DPO = close - SMA over N days, as at N/2+1 days ago
This is somewhat similar to momentum (see Momentum and Rate of Change), but instead of taking the close N days ago, an average (the SMA) of N days surrounding that point is used.
The directional movement index by J. Welles Wilder expresses so-called directional movement, from high to high, or low to low, as a percentage of true range (see True Range).
When today's high is above yesterday's high, the increase is upwards directional movement, written DM+. If today's high is not above yesterday's then DM+ is zero. Conversely when today's low is less than yesterday's low the decrease is downward directional movement, written DM-. Again if today's low is not below yesterday's then DM- is zero. Both DM+ and DM- are positive numbers, the “+” and “-” signs just refer to the direction of the movement.
On an “inside day” where today's trading range is entirely within yesterday's both DM+ and DM- are zero. On an “outside day” where today's trading goes both above and below yesterday's range, only the larger of DM+ and DM- is used and the other is set to zero.
The two DM+ and DM- series are each smoothed with an N-day exponential moving average (see Exponential Moving Average) and expressed as a percentage of average true range (see Average True Range). The ATR uses the same N-day EMA smoothing. Two lines are formed, the upwards directional index DI+ and downwards directional index DI-.
EMA[N] of DM+ EMA[N] of DM+ DI+ = 100 * ------------- DI+ = 100 * ------------- ATR[N] ATR[N]
In Chart, DI+ is drawn in green (for upwards) and DI- is drawn in red (for downwards).
The smoothing N is by Wilder's reckoning of EMA smoothing period (as discussed in Exponential Moving Average), the default is the 14 he recommended.
An extreme of 100 is approached on DI+ when each day trades entirely above yesterday's range (eg. runaway gaps), and then closes at the high of the day. This is rather rare, usually there's some pullbacks. Essentially DM+ counts just the advance, the true range in the denominator counts the backtracking too. For DI-, an extreme of 100 is approached similarly when each day trades entirely lower the previous, and closes at its low.
The average directional index (ADX) combines DI+ and DI-, expressing their difference (ignoring the sign) as a percentage of the total, forming a single line ranging 0 to 100,
abs(DI+ - DI-) ADX = 100 * -------------- DI+ + DI-
Bull power and bear power by Dr. Alexander Elder show where today's high and low lie relative to the a 13-day EMA (see Exponential Moving Average) of the closing prices.
Bull power = High - EMA[13] of close Bear power = Low - EMA[13] of close
Bull power is drawn in green and the bear power in red. The 13-day period is an option (see View Style). A 13-day EMA can be selected in the top window to show the basis for the calculation there. The indicator lines are in a sense “detrended” variations around that average.
Elder takes the 13-day EMA to be a consensus of value, and the amount bulls can push the daily highs above that is their power, and conversely the amount the bears can push daily lows below it is theirs (sending the bear power line negative).
The ease of movement indicator by Richard Arms shows a ratio of price movements over volume. Big moves on light volume mean easy movement through price levels, small moves and/or heavier volume means difficult movement.
midpoint[today] - midpoint[yesterday] Ease = ------------------------------------- box ratio
The midpoint is the middle of the day's trading range, ie. (high+low)/2. The box ratio is volume over trading range, giving the amount of volume required to move by one price tick, on the day.
volume[today] box ratio = ------------------------ high[today] - low[today]
Ease of movement is smoothed with an exponential moving average (see Exponential Moving Average), with default 14 periods. The raw daily values can be seen, if desired, by setting the average to 1 day.
http://www.mesasoftware.com/technicalpapers.htm
The fisher transform indicator by John Ehlers is a range oscillator showing where today's price is within the past N-days highest and lowest. It has some smoothing, plus what's known in mathematics as a fisher transform.
The range position is similar to Stochastics and to Williams %R (see Stochastics, and see Williams %R). The fisher transformation stretches out values near the N-day high and low, so as to help highlight extremes.
The calculation is as follows. The prices used are the midpoint between the day's high and low (as in most of Ehlers' indicators). Today's price is located within the highest and lowest of those midpoints from the past N days, scaled to -1 for the low and 1 for the high.
price = (high + low) / 2 price - Ndaylow raw = 2 * ------------------ - 1 Ndayhigh - Ndaylow
This raw position is smoothed by a 5-day EMA (see Exponential Moving Average) then a log form which is the fisher transform, before a final further 3-day EMA smoothing.
smoothed = EMA[5] of raw 1 + smoothed fisher = EMA[3] of log ------------ 1 - smoothed
The effect of the logarithm is to make “smoothed” values near 0 remain near there, but values near 1 and -1 grow greatly, thus highlighting extremities. A “smoothed” value of exactly +/-1 would transform to +/-infinity, so a clamp of 0.999 is applied, effectively limiting the final result to about +/-7.5.
The force index by Dr. Alexander Elder shows daily close-to-close changes multiplied by the volume traded, so that moves on greater volume are given more significance. The raw change*volume values are smoothed slightly with a 2-day EMA (see Exponential Moving Average), so the formula is simply
Force Index = EMA[2] of (volume * (close - prev close))
An increasing force index indicates strong interest in an upward move, when it falls back either price or volume has dropped off suggesting waning interest. Conversely for a negative and falling force index on the downside. The smoothing period for the EMA is configurable in Chart.
The %F forecast oscillator by Tushar Chande shows deviation between today's closing price and an N-day linear regression forecast (see Linear Regression) of that close. The deviation is expressed as a percentage of the close, so the formula is
close - forecast %F = ---------------- * 100 close forecast = linear regression of previous N days, at today
The N days prices for the linear regression start from yesterday's close, and the forecast value is the line extended out to today. This forecast line is like the EPMA (see Endpoint Moving Average), but going out one day further. Chande suggests using a 5 day regression for short term trading, and that's the default in Chart.
The Gopalakrishnan Range Index (GAPO) by Jayanthi Gopalakrishnan quantifies the variability in a stock, based on the logarithm of the trading range over an N-day period (default 5 days).
log(high[Ndays] - low[Ndays]) GAPO = ----------------------------- log(N)
The idea is to identify markets which are more erratic than others. It will be noted though that there's no scaling to the overall price level. In Chart GAPO is a low priority indicator, shown near the end of the indicator selection lists.
The Hurst exponent is a measure of fractional dimension, in which certain statistics are related to data length N by a power law,
Func(N) = constant * N^H
For example short-term movement in share prices might show small waves, then looking at an intermediate term could reveal bigger waves imposed on top of them, and then at even bigger time scales even bigger and longer waves on top of that. The methods below for estimating H measure to what degree such “self-similarity” exists, or not.
An exponent H = 0.5 is characteristic of a random walk, where each movement up or down is random and independent every day. This level is shown as a line in Chart. Above 0.5 suggests persistence of long term behaviour, and below it anti-persistence (a tendency to not persist).
Chart applies each of the methods below to logarithms of closing prices, so as to work on cumulative percentage returns rather than absolute amounts. This is vital when covering long periods of time. The calculations also end up ignoring any overall average rise (or fall), so for instance if share prices in the long term increase by 8% a year then only the variations around that are considered when looking at long/short term similarity.
The rescaled range method was developed by Howard Hurst and built on by Benoit Mandelbrot and Wallis. It looks at how the range of a series of values increases on bigger segments of data. This range is relative to a line drawn between the endpoints (representing the average increase or decrease), and is “rescaled” by the standard deviation of the step differences.
The formula is then
(R/S) on N points = constant * N^H
To get rid of the constant in the calculation sections of the data with different lengths N are taken and R/S values calculated, with H then being the slope of a log/log plot of R/S against N, ie.
(log R/S) = H * (log N) + (log constant)
Chart uses the standard approach of taking the whole data, then two halves of length N/2, then four quarters of N/4, etc. The R/S values calculated at a given length are then averaged. The successive halving stops at a minimum of 8 points to a segment. A linear regression (see Linear Regression) is then used to fit a slope H.
http://www.physionet.org/physiotools/dfa/
The detrended fluctuation analysis method by Peng, Havlin, Stanley and Goldberger is similar to the R/S above, but instead of the range on each segment of data, it calculates the standard error from a linear regression line fitted through the data points. This obeys the same sort of power law
F(N) = constant * N^H
and the same division into segments is used to find H.
The intraday momentum index (IMI) by Tushar Chande expresses upward open-to-close movement in the past N days as percentage of total open-to-close movement (up and down).
Sum[N] of max(close-open, 0) IMI = ---------------------------- Sum[N] of abs(close-open)
This is like an RSI (see Relative Strength Index) but on open-to-close movement and with a simple moving average. The use of open-to-close is also similar to the way Qstick (see Qstick) shows proportions of black and white candlesticks, with IMI scaling according to the total real-body height in the past N days.
The Klinger volume oscillator (KVO) by Stephen J. Klinger is based on cumulative volume, with volume added or subtracted according to the direction of “typical prices” and weighted by a certain daily range calculation.
A trend direction is determined from today and yesterday's “typical prices” (which are (high+low+close)/3),
trend = / 1 if TP[today] > TP[yesterday] \ -1 if TP[today] <= TP[yesterday]
A daily measurement DM = high-low is calculated and then a cumulative measurement formed (cumulative while the trend direction is the same),
CM[today] = / CM[yesterday] + DM[today] if trend[today]==trend[yester] \ DM[yesterday] + DM[today] if trend[today]!=trend[yester]
A “volume force” is then formed by accumulating volume amounts, with the “trend” factor making them add or subtract according to the typical price direction, and with the values scaled by DM and CM.
VF = volume * trend * abs(2*DM/CM - 1)
The Klinger oscillator is then formed as the difference between fast (34-day) and slow (55-day) EMAs (see Exponential Moving Average) of the volume force.
KVO = EMA[34] of VF - EMA[55] of VF
This is drawn in green, and a trigger line is drawn in red, being a 13-period EMA of the KVO line. The view style (see View Style) has an option to draw the difference between the two lines as a histogram, in MACD style (see MACD).
The raw volume force can be viewed directly if desired, it's a low priority option “KVO volume force” near the end of the indicator lists.
The MACD (Moving Average Convergence/Divergence) indicator by Gerard Appel shows how two moving averages on closing prices come together or move apart (ie. converge or diverge). The main MACD line is the difference between a fast and slow EMA (see Exponential Moving Average), this is shown in green in Chart.
MACD = EMA[12] of price - EMA[26] of price
A signal or trigger line is then formed by smoothing this with a further EMA. This is shown in red in Chart.
signal = EMA[9] of MACD
A crossing of the MACD up through the signal line is taken as a buy signal, or downwards a sell signal. The difference between these lines is shown as a histogram (solid white block). This helps show whether the lines are coming together or going further apart.
histogram = MACD - signal
Crossings of the MACD line up or down through zero are also interpreted as bullish or bearish (respectively). This corresponds to crossings of the underlying EMA[12] up or down through the EMA[26].
Periods 12,26,9 are frequently used, but can be varied in Chart (see View Style).
The MASS index by Donald Dorsey is based on daily trading range. Each day's range high to low is calculated and those values are smoothed with a 9-day EMA (see Exponential Moving Average). A ratio of that value with a second EMA smoothing is then taken, and the past 25 days of those ratios added up.
EMA[9] of high-low MASS = Sum[25] of ----------------------- EMAofEMA[9] of high-low
The EMA and the EMA of EMA are normally quite close, making their ratio usually about 1 and hence the sum formed is usually close to 25. The most significant pattern Dorsey looked for was a “reversal bulge” where the index goes above 27 then falls back below 26.5, indicating a widening of daily trading range and suggesting a reversal in price is likely.
Applying an EMA a second time gives a quite different result from a plain EMA. It'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' influence is in fact smaller than the peak weights (at about N/2 days back). The following graph shows the weights for N=10.
The twice-smoothed EMA is also available directly as a moving average option, to see its effect on prices or on an oscillator.
Momentum and rate of change show a difference between today's close and the close N days ago. Momentum is the difference as a price amount (positive or negative), rate of change scales it to a percentage increase or decrease from that N-day ago close. This scaling is an advantage if comparing past times when prices levels were much higher or lower than now. If p1 is today, p2 yesterday, etc, then
Momentum = p[1] - p[N+1] p[1] - p[N+1] ROC = 100 * ------------- p[N+1]
It will be noticed that momentum is the difference between an N-day simple moving average (see Simple Moving Average) for today and yesterday, with a scale factor N, ie.
Momentum -------- = SMA[today] - SMA[yesterday] N
This is the slope of the SMA line (price change per day) at that point. Momentum crosses up through zero when SMA makes a peak, or down through zero when SMA makes a trough. The TRIX indicator (see TRIX) does a similar thing with a triple exponential moving average.
The Money Flow Index (MFI) is an oscillator ranging from 0 to 100, showing dollar volume (referred to as “money flow”) on up days as a percentage of total up and down days, in a given N days.
The calculation is as follows. A “typical price” is formed from the average of high, low and close. If high/low figures are not available then Chart just uses the close,
high + low + close typical price = ------------------ 3
“Money flow” on a given day is typical price multiplied by volume. This is the money that flowed, ie. an approximation to the dollar volume traded.
money flow = typical price * volume
Across the N-day period two totals are formed. “Positive money flow” is the money flow on days where the typical price is higher the the previous day's typical price, and “negative money flow” when below. Days when typical price is unchanged are ignored. The MFI is then
positive money flow MFI = 100 * ----------------------------------------- positive money flow + negative money flow
Generally an MFI level of 80 is considered overbought, and 20 considered oversold. Those levels are shown as shown as dashed lines.
MFI is similar to RSI (see Relative Strength Index) in its construction and use. Both are looking at up days versus totalled up and down days, but the RSI scales by price change amounts where MFI scales on volume (or dollar volume approximation rather).
It should be noted “money flow” refers to dollar volume, ie. the total value of shares traded. Sometimes finance commentators speak of money “flowing into” a stock, but that expression only refers to buyers being enthusiastic. Obviously there's never any net money in or out, because for every buyer there's a seller of the same amount.
For the purposes of the MFI, “money flow”, ie. dollar volume, on an up day is taken to represent the enthusiasm of buyers, and on a down day to represent the enthusiasm of sellers. An excessive proportion in one direction or the other is interpreted as an extreme, likely to result in a price reversal.
The Negative Volume Index (NVI) and Positive Volume Index (PVI) by Norman Fosback (http://www.fosback.com) track price changes according to changes in volume. The NVI tracks closing price changes that occur on days with lower volume than yesterday, and the PVI conversely tracks those with higher volume than yesterday.
/ close | ----------- if vol < vol[prev] NVI = NVI[prev] * | close[prev] | \ 1 if vol >= vol[prev]
/ close | ----------- if vol > vol[prev] PVI = PVI[prev] * | close[prev] | \ 1 if vol <= vol[prev]
The fraction close/close[prev] means that the indexes follow percentage daily changes in the closing prices, but only changes on the selected lower or higher volume days are used. The starting point for the changes is arbitrary, only the shape of the resulting line matters. In Chart a start is made at 100 on the first data portion displayed.
The principle behind the NVI is that on high volume days an uninformed crowd is dominating, whereas on quieter days “smart money” is establishing positions. Fosback holds there's a 95% probability of a bull market when the NVI rises above its one-year moving average. Such an average can be viewed in Chart by selecting an SMA (see Simple Moving Average) of 260 days (one year's worth of weekdays).
On-balance volume (OBV) is a running total of daily volume, with volume on an up day added and volume on a down day subtracted. An up day is a close higher than the previous day's close, and vice versa a down day. So if p1 is today's close and p2 is yesterday's, the formula is simply
/ v1 if p1 > p2 | OBV = OBVprev + | 0 if p1 = p2 | \ - v1 if p1 > p2
The starting point (ie. the zero point) for the running total is arbitrary. In Chart it's merely the segment of data first displayed.
See also Price and Volume Trend, and Accumulation/Distribution, which accumulate volume in similar ways.
The Polarized Fractal Efficiency indicator by Hans Hannula shows how efficient, meaning how much like a straight line, the price movement has been over the past N days.
The net distance travelled over the past N days is expressed as a percentage of the total of each day's distance travelled. Distance is measured in two-dimensions, like a ruler on the plotted graph. Rise (or fall) is expressed as a percentage, and each day counts as 1 unit across. So the formula, on closing prices p1 (today) to pN is
Sign(p1-pN) * Hypot(N-1, Pchg(p1,pN)) PFE = 100 * ------------------------------------------------------- Hypot(1, Pchg(p1,p2)) + ... + Hypot(1, Pchg(p[N-1],pN)) Sign(X) = 1 if X>0, or -1 if X<0 new - old Pchg(new,old) = 100 * --------- old Hypot(x,y) = sqrt (x^2 + y^2)
Here “Pchg” is a percentage change up or down from “new” to “old” price, and “Hypot” is the distance (the hypotenuse) for a move of X horizontally and Y vertically. “Sign” means that PFE is positive or negative according to whether the change over the past N days is up or down.
At the extremes of 100 or -100, price movement is at maximum efficiency, with the past N days making a perfectly straight line. An almost straight line is generally very close to 100 too. A midpoint of 0 means there's been no net change over the past N days.
Hannula looked at price changes over 10 day period (horizontal distance of 9), and this is the default in Chart. A smoothing parameter is provided too; it applies an exponential moving average (see Exponential Moving Average) to the PFE. The default is 5 days smoothing, a value of 0 means no smoothing (to see the raw values).
The “Pretty Good Oscillator” (PGO) by Mark Johnson measures the distance of the current close from its N-day simple moving average (see Simple Moving Average), expressed in terms of an average true range (see Average True Range) over a similar period.
close - SMA[N] of closes PGO = ------------------------ EMA[N] of true range
So for instance a PGO value of +2.5 would mean the current close is 2.5 average days' range above the SMA.
Johnson's approach was to use it as a breakout system for longer term trades. If the PGO rises above 3.0 then go long, or below -3.0 then go short, and in both cases exit on returning to zero.
Price and Volume Trend (PVT) is a running total of daily volume, with each day's volume added or subtracted according to the percentage change in the today's closing price over yesterday's.
close[today] - close[yesterday] PVT = PVTprev + volume * ------------------------------- close[yesterday]
The starting point (ie. the zero point) for the running total is arbitrary. In Chart it's merely the segment of data first displayed.
PVT is similar to On-balance volume (see On-Balance Volume), but accumulating a portion of the volume. And see also Accumulation/Distribution, which also accumulates volume.
The Qstick indicator shows the dominance of black (down) or white (up) candlesticks, which are red and green in Chart, as represented by the average open to close change for each of past N days.
close[1]-open[1] + ... + close[N]-open[N] Qstick = ----------------------------------------- N
Days which are up have positive amounts for close-open, days which are down have negative amounts. In adding them up they cancel out until the dominance of one over the other results.
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 coefficient of determination of the prices versus a straight line. This coefficient is written 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,...,N. Variance is the square of standard deviation (see Standard Deviation).
(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
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. They also described a 14-day simple moving average (see Simple Moving Average) on the raw values, and that can be shown in Chart the same as any average on an indicator (see View Style).
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 in 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
High[today] - Low[K] 1 -------------------- * ------ Average TR [K] sqrt(K)
which is the move from the low K days ago up to today's high, scaled by an average of the true range (TR, see 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 High[K] - Low[today] for the movement down from past high to today's low.
The factor 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 sqrt(K). So the formula compares observed distance in average day's steps compared to the sqrt(K) steps which would be the expected move if it were random. So 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.
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 (see Simple Moving Average). The defaults are 7 days and 65 days.
abs (SMA[short] - SMA[long]) RAVI = 100 * ---------------------------- SMA[long]
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 (see Exponential Moving Average).
For each day an upward or downward movement is calculated. On an up day
U = close[today] - close[yesterday] D = 0
or on a down day as follows (notice D is a positive amount),
U = 0 D = close[yesterday] - close[today]
The sequence of U values over time is averaged with an EMA (see Exponential Moving Average) and likewise the D values. The ratio is the “relative strength”,
EMA[N] of U RS = ----------- EMA[N] of D
This is turned into an index between 0 and 100,
1 RSI = 100 * ------ 1 + RS
This can also be written as follows, emphasising the way the RSI expresses up movement as a proportion of the two up and down,
EMA[N] of U RSI = 100 * ----------------------------- (EMA[N] of U) + (EMA[N] of D)
Wilder recommended a smoothing period of N=14, and that's the default in Chart. Note also that the period is interpreted by Wilder's reckoning of EMA smoothing (see Exponential Moving Average).
An index value of 70 is considered overbought and 30 oversold; those levels are shown as dashed lines. The principle is that after a large proportion of movement in one direction, a reaction the other way becomes likely. On the other hand it's easy to see from the formula that a steady progressive trend (every day up, or every day down) can push the RSI to an extreme and hold it there.
The term “relative strength” also refers to a comparison between a stock and the overall market. This is sometimes called “relative strength comparative” to avoid confusion. This is unrelated to the relative strength and relative strength index described in this section.
A variation of the RSI can be made using simple moving averages (see Simple Moving Average) of U and D over N-days, instead of exponential moving averages. This is selected by the “SMA” option in the indicator parameters (see View Style). It's sometimes called Cutler's RSI.
This SMA also gives the Chande Momentum Oscillator (CMO) by Tushar Chande. The CMO formula is as follows, and the result is the same as an SMA RSI, just the scale differs (-100 to +100 instead of 0 to 100).
U - D CMO = 100 * ----- U + D
The stochastic RSI is an N-day unsmoothed %K stochastic (see Stochastics) applied to the RSI line. The position of today's RSI is expressed as a fraction 0 to 1 of its overall range (lowest to highest) in the past N days (the same N as used for the RSI calculation),
RSI[today] - RSI[Nday low] Stoch RSI = ------------------------------ RSI[Nday high] - RSI[Nday low]
The Relative Volatility Index (RVI) by Donald Dorsey is similar to the RSI (see Relative Strength Index) but where the RSI adds up price change amounts based on price direction, the RVI instead adds standard deviations (stddev, see Standard Deviation) based on price direction.
That stddev amounts are partitioned between up days and down days, as in an RSI,
U = / Stddev(10\,days) if price > prev price \ 0 otherwise D = / Stddev(10\,days) if price <= prev price \ 0 otherwise
The sequence of U values over time is averaged with an EMA (see Exponential Moving Average) and likewise the D values. A proportion of up against total is then formed. The following is Dorsey's original 1993 definition of RVI on closing prices.
EMA[N] of U RVIorig = 100 * ----------------------------- (EMA[N] of U) + (EMA[N] of D)
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.
RVIorig of highs + RVIorig of lows RVI = ---------------------------------- 2
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 smoothing of 14 days are parameters (see View Style). The EMA period follows J. Welles Wilder's reckoning of EMA smoothing, the same as in RSI parameters (see Exponential Moving Average).
Dorsey also smoothed the RVI with a 20-day least squares moving average (LSQMA, see 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.
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.
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.
close - low[N] %K = 100 * ---------------- high[N] - low[N]
An extreme of 0 is reached for a close at the day's low and a fresh N-day low. Likewise 100 for a close at the day's high and a fresh N-day high. A signal line %D is added by smoothing %K with a simple moving average (see Simple Moving Average).
%D = SMA[D] of %K
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.
%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 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.
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 (see Relative Strength Index) but looks at 2-day changes in the daily high and daily low values and smooths with a 5-day SMA (see 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 +45 or below -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.
The trend intensity index (TII) by M. H. Pee is a measure of 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 (see Simple Moving Average).
The 60-day average is just today's level, it's not the level at each of those past 30 days. For each day the deviation close-avg is taken. Positive amounts are up deviations, and negative amounts have the sign discarded and are down deviations.
up = / close - average if close > average \ 0 otherwise down = / average - close if average < close \ 0 otherwise
The percentage of the total up amounts out of the total up and down amounts is then the trend intensity index,
total up TDI = 100 * --------------------- total up + total down
The extreme of 100 occurs when all closes in the past 30 days have been above today's 60-day moving average level, and conversely the extreme of 0 when all below that level.
Visually the index is like looking at the area under the graph of prices. The area above a horizontal line at today's 60-day moving average is the up amounts, the area below it is the down amounts, and the index is the fraction of the up out of the total.
Pee recommended entering trades when levels of 80 on the upside or 20 on the downside are reached. Lines are shown in Chart at those levels, as is 50 which is a neutral level.
The 60 and 30 days are configurable (see View Style). Any values are accepted, but it probably doesn't make much sense to have the MA period (60) shorter than the deviations period (30). Certainly it makes no sense to have the two equal (the up deviations are then exactly 50% of the total).
Trendscore by Tushare Chande3 rates the strength of a trend. The calculation is quite simple, today's close is compared to each close at 11 through 20 days ago and scored +1 for each it's above and -1 if below.
Trendscore = if close >= close[11] then +1 else -1 + if close >= close[12] then +1 else -1 ... + if close >= close[12] then +1 else -1
The result is a rating between +10 or -10 for how many of those past days the current close is above. The high of +10 is when above all those past prices, or -10 when below them all. In a good trend up or down those extremes are often reached.
The true strength index (TSI) by William Blau4 is a double-smoothed variation on the RSI (see Relative Strength Index). It expresses recent close-to-close changes up or down as a proportion of total close-to-close movement,
EMA[13] of EMA[25] of (close - prevclose) TSI = 100 * ------------------------------------------- EMA[13] of EMA[25] of abs(close - prevclose)
The TSI ranges from -100 up to +100 with positive values representing upward momentum and negative values downward momentum. Extreme values can be interpreted as overbought and oversold, as per the ordinary RSI.
The similarity to the RSI can be seen by changing the TSI smoothing parameters. A period of 27 days for the first EMA and 1 for the second (to mean no extra smoothing) is the same as a 14-day RSI, just on a scale -100 up to +100 instead of 0 up to +100 for the RSI. The difference in the periods is because the RSI parameters are set by J. Welles Wilder's EMA period reckoning (see Wilder EMA period).
See EMA of EMA for the effect of two EMAs. In general it leads to less weighting on the most recent data (in this case close-to-close changes) than a single EMA.
TRIX by Jack Hutson shows the slope of a triple-smoothed N-day exponential moving average of closing prices. The slope is calculated as a percentage change between today and yesterday's triple EMA values.
TripleEMA[today] - TripleEMA[yesterday] TRIX = 100 * --------------------------------------- TripleEMA[yesterday]
A positive TRIX means the triple EMA is rising, suggesting a steady uptrend, in the same way any rising moving average does. Conversely a negative value means the triple EMA is falling, suggesting a downtrend. A cross through zero is a peak or trough in the triple EMA and may suggest a trend change. Chart draws a line at the zero level.
A triple smoothed EMA is prices smoothed with an EMA then those values smoothed again with another EMA and finally a third time with a further EMA (all of the same given period). The result is quite different from a plain EMA. It'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' influence is in fact smaller than the peak weights (at about N-days back). The following graph shows the weights for N=10.
The triple 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.)
http://www.incrediblecharts.com/technical/twiggs_money_flow.htm
The Twiggs money flow index by Colin Twiggs is a variation of the Chaikin money flow index (see Chaikin Money Flow) using true range so as to include gap moves, and using EMA smoothing (see Exponential Moving Average) to avoid jumps when a high volume day drops out of the calculation. The formula is
/ close - truelow \ EMA[N] of volume * | 2 * ------------------ - 1 | \ truehigh - truelow / Twiggs MF = -------------------------------------------------- EMA[N] of volume truehigh = max (high, prevclose) truelow = min (low, prevclose)
The default EMA period is 21 days, and the period is reckoned by J. Welles Wilder's method (see Exponential Moving Average).
The Ultimate Oscillator by Larry Williams is based on buying pressure as a proportion of true range over recent periods, with the past 7 days, 14 days and 28 days combined together.
The calculation starts with “buying pressure”, which is the amount by which the close is above the “true low” on a given day. The true low is the lesser of the given day's trading low, and the previous close.
bp = close - min (low, prev close)
The true range (the same as in True Range) is the difference between the “true high” and the true low above. The true high is the greater of the given day's trading high, and the previous close.
tr = max (high, prev close) - min (low, prev close)
The total buying pressure over the past 7 days is expressed as a fraction of the total true range over that period. If bp1 is today, bp2 yesterday, etc then
bp1 + bp2 + ... + bp7 avg7 = --------------------- tr1 + tr2 + ... + tr7
The same is done for the past 14 days and past 28 days and the resulting three values combined in proportions 4:2:1, and expressed as a percentage.
4 * avg7 + 2 * avg14 + avg28 UltOsc = 100 * ---------------------------- 4 + 2 + 1
The oscillator ranges from 0 to 100 and is interpreted in similar ways to other oscillators, with extremes indicating overbought or oversold conditions, and bullish or bearish divergence when new lows or highs fail to be made. Williams recommended levels of 70 and 30 for overbought or oversold and those are drawn by Chart.
The volatility ratio by Jack Schwager expresses the latest day's trading range as a ratio of the overall range for a past N days. “True range” is used for both (see True Range), so gaps are included in the calculation.
For an N-day true range the close immediately preceding those N days is incorporated. Thus
TR Ndays = max(high[1], high[2], ... high[N], close[N+1]) - min(low[1], low[2], ... low[N], close[N+1])
The volatility ratio is then simply
TR VOLR = -------- TR Ndays
When a strong breakout from a tight range occurs the day's range can be a sizeable fraction of the recent range. A level of 0.5 is considered significant and that's drawn as a line in Chart.
http://www.tangotools.com/ui/ui.htm
The Ulcer Index by Peter Martin is a measure of downside volatility. For a given N-day period the closing prices are considered from oldest to newest and for each a retracement percentage is calculated, relative to the highest close so far.
price[i] - maxprice so far R[i] = -------------------------- maxprice so far
So for instance a price $5.00 falling back to $4.50 is a -10% retracement. These are averaged with a quadratic mean, which has the effect of emphasising large drawdowns, but incorporating all into the result.
/ R[1]^2 + R[2]^2 + ... + R[N]^2 \ Ulcer = sqrt | ------------------------------ | \ N /
The index can be calculated over the kind of period one might hold an investment to calculate a measure of the ulcer-producing drawdowns suffered during that period.
The vertical horizontal filter (VHF) by Adam White expresses trading range as a fraction of total close-to-close movement over a given N-day period.
highest close - lowest close VHF = ------------------------------------- total of each abs(close - prev close)
This ratio ranges from 0 to 1. The extreme of 1 means all movement was in one direction, so all close-to-close movements added up to the high to low range. A usual value is somewhere in the middle, reflecting a mixture of advances and retreats that occur even in a strong market.
Volume can be viewed in the lower indicator window, when the data source provides volume figures. Amounts are in shares (or contracts) traded.
Open interest for futures contracts can be viewed similarly, for data sources which provide open interest figures.
The Williams Accumulation/Distribution index by Larry Williams forms a running total of “buying pressure” on up days, or “selling pressure” on down days.
/ (close - true low) if close > prev close WAD = WAD[prev] + | 0 if close = prev close \ (close - true high) if close > prev close
Buying pressure is represented by how far the close is above the true low (which is the lesser of today's low or yesterday's close). Selling pressure is represented by how far the close is below the true high (which is the greater of today's high or yesterday's close). Notice the difference “close - true high” is negative, so on down days WAD decreases.
The starting point (ie. the zero point) for the running total is arbitrary. In Chart it's merely the segment of data first displayed.
Williams %R by Larry Williams is an oscillator showing the day's close relative to the trading range of the last N days (the highest high to the the lowest low). The scale is 0 for a close at the high, down to -100 for a close at the low.
Williams used a 10 day period, which is the default in Chart, and held that a close above -20 suggested an overbought condition, and below -80 suggests oversold. Those levels are shown as lines in Chart. Extremes will be reached almost any time new N-day highs or lows are being made, so Williams' conditions for trading were to buy an oversold when
or conversely to sell an overbought
The zig zag indicator is a simple way to ignore retracements less than a given X percentage (based on closing prices).
When prices are rising, a line is drawn up from the previous low to the latest high. Pullbacks smaller than the given X% are ignored, the trend is only considered to have turned down when a point X% below the highest close is penetrated. Then a down line is drawn, it in turn continuing until a reversal of more than X% above the lowest close occurs. The result is a kind of zig zag, ignoring small moves (small according to the X%).
For the last line segment, at the right of the chart, the line is drawn to the high (or low) then horizontally to the edge of the screen. The horizontal part means there hasn't yet been a retracement of X% from that level shown.
The following are algorithms and calculations shared among various indicators and averages.
The “least squares” or “linear regression” algorithm produces a best fitting straight line through the middle of a set of N data points x1,y1, ..., xN,yN. In Chart this means a set of prices Y, and dates X (with non-trading days collapsed out).
For a possible fitted line L(X)= a + b*X, the vertical distance from the line to each point is squared, and a total deviation formed.
SumSquares = (y1 - L(x1))^2 + ... + (yN - L(xN))^2
The line parameters a and b are then chosen to make SumSquares as small as possible (hence the name “least squares”), and there's just one line with that smallest SumSquares. The calculation is made easier if the X coordinates are shifted so that Mean(X)=0. With that the formulas for a and b are
y1 + ... + yN a = Mean Y = ------------- N x1*y1 + ... + xN*yN b = ------------------- x1^2 + ... xN^2
A least squares fit is “best” under certain mathematical assumptions: basically that the data points were a straight line to which normally distributed random amounts (positive or negative) have been added. Of course an underlying straight line is unlikely in market price data, or in economics generally, and in particular any cyclical component invalidates the assumptions. Even so the algorithm is quite widely used because it offers an objective basis for fitting a line.
The slope of the linear regression line, the b above, is sometimes called the regression coefficient. This is available as an indicator (Linear Regression Slope), to show how steep the fitted trend line is. The units are price change per day, which is negative for a downward sloping line. This may or may not be particularly useful so it's a low priority option, shown near the end of the indicator lists.
Standard error (stderr) is a statistical measure of how much values differ from an assumed underlying curve. It's calculated as the quadratic mean of the vertical distances from each point to the curve. For a linear regression line this means
/ (y1 - (a+b*x1))^2 + ... + (yN - (a+b*xN))^2 \ Stderr = sqrt | ------------------------------------------- | \ N /
Notice the numerator is the same SumSquares which was minimized above. Standard error is similar to standard deviation (see Standard Deviation); but where stddev takes differences from a horizontal line (the mean Y), stderr goes from (in this case) the sloping linear regression line.
For reference, there's no need to actually calculate a and b, stderr can be formed directly as
/ Covariance(X,Y)^2 \ Stderr = sqrt | Variance(Y) - ----------------- | \ Variance(X) /
where variance and covariance are as follows (and notice they simplify if X values are chosen to make Mean(X) zero),
Covariance X,Y = Mean (X*Y) - (Mean X) * (Mean Y) Variance X = Mean(X^2) - (Mean X)^2
Standard error from a linear regression like this is used as a channel width in Kirshenbaum Bands (see Kirshenbaum Bands). It can also be viewed directly as an indicator, but this is probably of limited use and for that reason is a low priority selection, near the end of the lists.
Standard deviation (stddev) is a statistical measure of how much the values in a data set deviate from their average (mean). The stddev of a past N days is used in the calculation of Bollinger bands and VIDYA (see Bollinger Bands, and Variable Index Dynamic Average).
The raw stddev values can be shown in Chart as an indicator, to see what goes into those calculations. The values have little direct use though, and for that reason stddev is a low priority indicator, shown near the bottom of the indicator lists.
For reference, the formula on prices p1 to pN is as follows. Each p[i]-a is the distance from the mean, and those distances are averaged with a quadratic mean.
/ (p1-a)^2 + (p2-a)^2 + ... + (pN-a)^2 \ Stddev = sqrt ( ------------------------------------ ) \ N /
where a is the mean
p1 + p2 + ... + pN a = ------------------ N
Also, just for reference, the formula can be rearranged to the following form, “sum of the squares minus square of the sums”. This is what Chart uses, because a new term can be shifted into the sums without recalculating all N terms.
/ p1^2 + p2^2 + ... + pN^2 (p1 + p2 + ... + pN)^2 \ Stddev = sqrt ( ------------------------ - ---------------------- ) \ N N^2 /
True range is simply the day's trading range (high to low) extended to include the previous day's close, should that close be above the high or below the low.
true range = max(high, prev close) - min(low, prev close)
The effect is to include any “gap” left between yesterday's close and today's range. Quite often there's no gap, but when overnight news makes prices jump it can be desirable in some algorithms to include that distance.
When a stock doesn't have high/low values (some indexes for instance), then just close-to-close changes are used for true range, which may or may not be particularly useful.
Raw true range values are generally uninteresting, they're merely used in other indicators. Wilder's average true range (see Average True Range) uses smoothed true range values. Setting N=0 for the smoothing period can show the raw true range values if desired.
The watchlist window shows latest quotes for stocks and commodities in the favourites or other list. Double clicking an entry brings it up in the main Chart window. For example,
Symbol Bid/Offer Last Change High Low Volume When Notes ^GSPC / 1237.81 8.68 1228.33 1237.81 19m Thu GM / 34.91 -0.10 34.57 35.38 3.74m Thu BHP.AX 21.03/21.05 21.05 0.31 20.75 21.05 16m 10:45
The Refresh button downloads new quotes. For some data sources Chart knows the trading times, and if there won't be after hours changes then the quote locks to the end-of-day and is not re-downloaded until the next day.
The favourites list can be edited. New symbols are added by entering a symbol in the text box and pressing <Return>. If already present then the list just scrolls to it. Move entries by dragging. Delete an entry by selecting it (click or <space>) and pressing the Delete button.
The View/Intraday menu entry (<Ctrl-I>) opens an intra-day data window for the current symbol, showing trading today, or so-far today. The Intraday button in the watchlist does likewise (see Watchlist).
Intraday graphs are only available from some data sources (see Data Sources). Yahoo and Barchart provide graphs, which means most stocks and futures are covered.
The default display is 1-day, downloaded when the window is opened (and then cached). The option menu can select instead a 5-day or various amounts depending on the data source. Accelerator keys like <Alt-5> can be used (the underlines in the menu entries). Click on Refresh (<Alt-R>) to update as trading progresses through the day.
Multiple intraday windows can be opened, or a new symbol can be entered in the text box to view a different symbol (press <Return> or click the “Enter” button).
To see the intraday for a symbol not in the database or the watchlist, just open an intraday window for any symbol (or no symbol at all) then enter the desired one.
The Tools/Download menu entry opens the download dialog. Choose “What” to download, either all symbols, the favourites list, or a particular symbol. Then choose “When” for the period to download, either an update of new 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 status at the bottom shows progress. Errors are shown in the text window. If you're offline the error will usually be “host name lookup failure” or “network unreachable”. Press “Stop” to abort a download.
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. Unfortunately the database updates tend to make the GUI sluggish.
In the main Chart window, <Ctrl-U> initiates an update download for the currently viewed chart. This is a good shortcut to grab the latest for just one symbol.
You can run ‘chart --download’ to do a command-line (non-GUI) download (see 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.
Chart tries to know when to expect new data, and will do nothing in an update until then, but this is often imperfect. Public holidays (with no data) are not tracked, and it's easy for a data source to be delayed unexpectedly.
Note that data from each of these sources is subject to various disclaimers and conditions for its use. A summary of the restrictions is noted in each section. Links to the relevant parts of the web sites are provided, and should be consulted for full information.
The minimum terms for a source in Chart are that personal non-commercial use is permitted. In fact that's usually all that's permitted, and in particular any further copying or distribution is generally not allowed (and this will include derived forms like the graphs drawn by Chart).
http://www.ase.gr/default_en.asp
ATHEX provides
The content is for information only and is not to be retransmitted, see the disclaimer,
http://www.ase.gr/content/en/disclaimer/
In Chart ATHEX symbols have a ‘.ATH’ suffix, eg. ‘HTO.ATH’ for Hellenic Telecom. The home page has a company and symbol search. Only the English symbols are currently supported.
ASX shares are handled by a combination of Yahoo (see Yahoo Finance) for quotes and dividends, and Float (see Float) for daily and historical data. CommSec (see Commonwealth Securities) can also be used by CommSec clients.
In Chart, symbols for ASX shares follow the Yahoo convention, which is the ASX code and a ‘.AX’ suffix, eg. ‘NAB.AX’ for National Australia Bank. The ASX home page (above) has a symbol search, as does Yahoo,
http://au.finance.yahoo.com/l
Barchart provides the following for various futures exchanges around the world,
All information is for personal use only, see the terms at
http://www2.barchart.com/agreement.asp
http://www2.barchart.com/ddfplus.asp
In Chart symbols are the exchange commodity code and an exchange suffix as described below. The commodity alone is the current front month, like ‘GC.COMEX’ for gold, or a month code letter and year can be given for a particular month, like ‘CLZ07.NYMEX’ for December 2007 crude oil.
Some of the pages at barchart.com
show symbols with just one digit
for the year, but Chart always uses two like ‘07’ above. Barchart has
different commodity codes than the exchanges in some cases, but Chart always
uses the exchange codes.
Five days of historical data is of limited use, but it can be accumulated to at least get a short term picture. Further data as graphs is available, and Chart has that as an option in the intraday window (see Intraday). (Further historical data as figures is available to subscribers, not currently supported by Chart.)
For a number of the exchanges below quotes are also available from Yahoo (see Yahoo Finance). The format from Yahoo is much more compact and is hence preferred.
CBOT data is obtained from Barchart, and quotes from Yahoo (delayed 10 minutes). In Chart symbols have a ‘.CBOT’ suffix, for example ‘O.CBOT’ for oats. Symbols (and trading hours) can be found at
http://www.cbot.com/cbot/pub/page/0,3181,932,00.html
For some contracts Barchart has different symbols, but Chart always uses the exchange symbols.
CME data is obtained from Barchart, and quotes from Yahoo (delayed 10 minutes). In Chart symbols have a ‘.CME’ suffix, for example ‘SP.CME’ for S&P 500 futures. Symbols can be found at
http://www.cme.com/trading/res/cch/cmeprdcode2439.html
For some contracts Barchart has different symbols, but Chart always uses the exchange symbols.
COMEX is the metals division of NYMEX (see below). COMEX data is obtained from Barchart, and quotes from Yahoo (delayed 30 minutes). In Chart symbols have a ‘.COMEX’ suffix, for example ‘GC.COMEX’ for gold. Available symbols and months can be found at
http://www2.barchart.com/futexch.asp?exch=comex&code=BSTK
https://www.theice.com/nybot.jhtml
NYBOT data is obtained from Barchart, and quotes from Yahoo (delayed 30 minutes). In Chart, contract symbols have a ‘.NYBOT’ suffix. The commodity code alone is the front month, like ‘CC.NYBOT’ for cocoa. Or a specific month can be given, like ‘CTX07.WTB’ for November 2007 cotton. Commodity codes can be found at
https://www.theice.com/publicdocs/NYBOT_Products.pdf
NYMEX data is obtained from Barchart, and quotes from Yahoo (delayed 30 minutes). In Chart symbols have a ‘.NYMEX’ suffix, for example ‘CL.NYMEX’ for crude oil. Available symbols and months can be found at
http://www2.barchart.com/futexch.asp?exch=nymex&code=BSTK
And the exchange has a full symbols directory
http://www.nymex.com/cc_main.aspx
SIMEX is the derivatives arm of the Singapore Stock Exchange. SIMEX symbols have a ‘.SIMEX’ suffix, for example ‘NK.SIMEX’ for Nikkei 225 futures.
Symbols can be found on the contract specifications pages. On the home page under “Products and Services” choose “Derivatives” then either the “Equity Index Futures / Options” or “Interest Rate Futures / Options” items. Those two pages then have selection boxes to see each contract.
The MSCI Japan contract (symbol ‘JP’) is not available from Barchart, but all other contracts are. Intra-day graphs are not available.
Barchart has its own set of contract symbols, but Chart uses the exchange symbols.
BSX provides
Market depth is also available, but not currently used by Chart.
The content is provided for one's own reference only, see the terms and disclaimer,
http://www.bsx.com.au/_terms_and_conditions.asp
http://www.bsx.com.au/_disclaimer.asp
In Chart BSX symbols have a ‘.BEN’ suffix, eg. ‘CAP.BEN’ for Capilano Honey. Symbols can be found in the company selection pulldown for the three boards,
http://www.bsx.com.au/markets_pricesresearch.asp?board=prop
http://www.bsx.com.au/markets_pricesresearch.asp?board=main
http://www.bsx.com.au/markets_pricesresearch.asp?board=comm
The BSX web server can send pages in compressed form. Chart uses that when the gzip program or Zlib library are available, so get one of those two for faster downloading (see Installing).
http://www.casablanca-bourse.com/homeen.html
The Casablanca Stock Exchange provides
The web site terms can be found at the end of the home page. As of February 2009 reproduction of information is for personal private use.
In Chart Casablanca symbols are the exchange code and a ‘.CAS’ suffix. For example ‘MNG.CAS’ for Managem. A full list of symbols can be found at
http://www.casablanca-bourse.com/cgi/ASP/pts/pts_en.asp
or in the quotes by sector,
http://www.casablanca-bourse.com/cgi/ASP/Marche_Central/sectors_en.asp
These pages are normally displayed in a frame, reached from the home page “All About” link at the bottom left, or “Market data” “Central market” at the upper left.
http://www.c-com.or.jp/public_html_e/index/index.php
C-COM provides
The web site is provided under a disclaimer shown on the home page.
http://www.c-com.or.jp/public_html_e/footer/index.php
In Chart C-COM symbols are the commodity name (as per the quotes web page) with a ‘.CCOM’ suffix. The commodity alone is the front month, like ‘Gasoline.CCOM’. Or a month and year can be given for a specific contract, like ‘Eggs OCT 07.CCOM’ for December 2007 eggs. The current commodities are
Gasoline Kerosene Gas Oil Eggs Ferrous Scrap RSS3 TSR20 Rubber Index Aluminium Nickel
The last five (RSS3, TSR20, Rubber Index, Aluminium, Nickel) are from the Osaka Mercantile Exchange, which merged into C-COM at the end of 2006.
CommSec provides the following Australian Stock Exchange data (see Australian Stock Exchange),
This service is only for use by CommSec clients.
CommSec is used (when enabled) for updating individual stocks, since just a past few months can be downloaded, which is faster than full history downloads from Float (see Float). CommSec is preferred over Yahoo (see Yahoo Finance) since its data is available sooner than Yahoo. If you're a CommSec client you can enable it by entering “yes” in the Edit/Preferences dialog.
Float provides the following ASX data (see Australian Stock Exchange),
The home page invites use of the data download while the float database is being built, subject to a disclaimer at
http://www.float.com.au/scgi-bin/prod/terms.cgi
Float is preferred over Yahoo for daily data, because it's available sooner, and if you have lots of ASX symbols then whole-day files can be used, which are faster than a separate download for every stock.
When the unzip program is available, data is downloaded in Zip format. This is a significant saving and is recommended (see Installing).
Preliminary data for each day is available from Float at 5pm (Sydney time) but is updated until 9pm, so Chart deliberately doesn't download until 9:15pm.
See also Commonwealth Securities.
GSE provides
In Chart symbols are the exchange code and a ‘.GHA’ suffix, for example ‘CAL.GHA’ for CAL Bank Limited. Symbols can be found on the daily page,
http://www.gse.com.gh/marketstat/equitiesdef.asp
http://kanex.or.jp/english/index-eng.htm
KEX provides
lha
program
required). Each day's data is available at about 9:15am the following trading
day (Japanese time, and Monday for Friday's trading).
The web site is provided under a disclaimer (in Japanese but can be translated online by Google),
http://kanex.or.jp/basic/menseki.htmlhttp://translate.google.com/translate?u=http://kanex.or.jp/basic/menseki.html&langpair=ja%7Cen
In Chart KEX symbols are a commodity code and a ‘.KEX’ suffix. The commodity alone is the front month, like ‘EBI.KEX’ for frozen shrimp. Or a month and year can be given for a specific contract, like ‘KI JAN 08.KEX’ for January 2007 coffee index.
The commodity codes adopted by Chart are based on past download filenames (which have since changed). They are
Code Commodity CF
Coffee Index EBI
Frozen Shrimp KI
Corn75 Index N
US Non-GMO Soybeans RB
Azuki (Red Beans) SG
Raw Sugar BR
Broiler chickens CO
Yellow corn SM
Soybean meal
‘BR’ and ‘CO’ contracts are from the former Fukuoka Futures Exchange (FFE), which merged into KEX in 2006.
Data for raw silk (‘RS’) which was delisted in 2004 is no longer available for download.
Historical data is in LZH format and Chart requires the LHa archive program to extract it. Ensure lha is installed before downloading (see Installing).
KCBT provides
Liability for errors or omissions is disclaimed on the home page, and quotes and intraday charts are provided for personal use only, see the terms at
http://www.kcbt.com
http://www.kcbt.com/wheat_quotes.asp?page=agreement
In Chart KCBT symbols have a ‘.KCBT’ suffix. The commodity alone is the front month, like ‘KW.KCBT’ for wheat. Or a month and year can be given, like ‘MVM07.KCBT’ for June 2007 value line index.
Symbols and months can be found on the following quotes pages (javascript required). Note that although only one digit is shown for the year, Chart always uses two like ‘07’ above.
http://www.kcbt.com/wheat_quotes.asp?page=quote&sym=KW
http://www.kcbt.com/value_line_quotes.asp?page=quote&sym=MV
For the database, daily ‘KW’ wheat prices are available after 2:30pm (US
Central time), and volume after 6pm. ‘MV’ value line data comes from
barchart.com
(see Barchart), it's not clear when that's normally
available, Chart attempts after 8pm. (Quotes and intraday graphs also come
from Barchart, via links at KCBT.)
LJSE provides
The LJSE website information is for non-commercial use only. See the terms at
http://www.ljse.si/cgi-bin/jve.cgi?doc=1506
In Chart LJSE stock symbols have a ‘.LJ’ suffix, for instance ‘ACLG.LJ’ for ACH d.d., and similarly bonds like ‘RS62.LJ’. Indexes have a ‘^’ prefix, for instance ‘^SBI20.LJ’ for the Slovenian 20. All prices are in Euros (having converted from Slovenian Tolar in January 2007).
The data archive downloads only give average daily prices. The whole-day files (which are used for quotes) have high/low ranges and trading volume, but at 160k per day it would be too much to download them for a past few years data.
LME provides
All data is for personal use on a local hard disk only, see the main terms and additional historical prices terms. Pay particular attention to the latter, since Chart will automatically send “agreed” on your behalf when downloading.
http://www.lme.co.uk/legal.asp
http://www.lme.co.uk/dataprices_historical.asp
Latest daily settlement prices are only available to registered users of the “free data service”, and Chart needs either GnuTLS or OpenSSL to access the server (see Installing). You can register at the following page; then put your username and password in Chart in the Edit/Preferences dialog.
https://secure.lme.com/data
Note that for the HTTPS connection Chart doesn't attempt to validate the server's identity credentials, so the connection is encrypted, but where it's actually going is not checked.
If you haven't registered or don't have the necessary libraries you can still use the per-month data files.
For metals, Chart symbols are the commodity name, a forward months number, and a ‘.LME’ suffix. The commodity alone is the cash price, like ‘ALUMINIUM ALLOY.LME’ or ‘LMEX.LME’, and forward prices have months 3, 15 or 27, like ‘TIN 3.LME’ or ‘NASAAC 27.LME’.
Available contracts can be found on the metals price page of the free data service (registration required, per above). The contracts are the columns plus LMEX near the end).
https://secure.lme.com/Data/community/Dataprices_daily_metals.aspx
Currently these are as follows
ALUMINIUM.LME ALUMINIUM ALLOY.LME COPPER.LME LEAD.LME LMEX.LME NASAAC.LME NICKEL.LME TIN.LME ZINC.LME
The historical downloads don't have LMEX values, so the initial download for that is only the past 20 days. (It'd be possible to go back further, but at 70 kbytes per day the amount downloaded soon becomes large).
Prices are in US$/tonne, the settlement currency rates (Sterling and Euros) are not used.
For plastics, Chart symbols are the commodity code and a ‘.LME’ suffix, like ‘PP.LME’ for polypropylene.
Available contracts can be found on the plastics price page of the free data service (registration required, per above).
https://secure.lme.com/Data/community/Dataprices_daily_plastics.aspx
Currently these are as follows
Symbol Commodity PP.LME
Polypropylene PA.LME
Polypropylene Asia PE.LME
Polypropylene Europe PN.LME
Polypropylene North America LL.LME
Linear Low LA.LME
Linear Low Asia LE.LME
Linear Low Europe LN.LME
Linear Low North America
MGEX provides
All data is for personal-use informational purposes only, see the disclaimer and terms,
http://www.mgex.com/disclaimer.html
http://www.mgex.com/quotes.html?page=agreement
In Chart MGEX symbols have a ‘.MGEX’ suffix. The commodity alone is the front month, like ‘MW.MGEX’ for hard red spring wheat. Or a month and year can be given for a specific contract, like ‘ICK07.MGEX’ for May 2007 national corn index.
Available commodities are listed on the following quotes page. A summary of the symbols is at the bottom of the page, current symbols and months can be found by following the links.
http://www.mgex.com/quotes_charts.html
MGEX data actually comes from barchart.com
(see Barchart). The
format in the MGEX links is more compact than what Barchart itself offers, and
is hence preferred.
MLC provides the following for its investment funds and superannuation funds,
The web site is for general information only, and only provided for residents of Australia, see the disclaimer at
http://www.mlc.com.au/mlc/im_considering_mlc/personal/footer_tools/advice_warning_and_disclaimer
Downloads use https
so Chart needs either GnuTLS or OpenSSL to access
the server (see Installing).
There are no apparent fund symbols so Chart uses the full fund and product name, with a ‘.MLC’ suffix. For example,
MLC Property Securities Fund,MasterKey Superannuation (Gold Star).MLC
This is a lot to type, but it can normally be cut and pasted from the full list at the following unit prices page (the page source has the fund and product names together),
https://www.mlc.com.au/masterkeyWeb/execute/FramesetUnitPrices?null
MX provides
All data is for personal non-commercial use only, see the disclaimer at the bottom of the home page, and the “terms of use” link in that paragraph.
In Chart MX symbols have a ‘.MON’ suffix. (It's not ‘.MX’ because that's already taken by Yahoo for the Mexico Stock Exchange.) The commodity alone is the front month, like ‘CGB.MON’ for 10-year Canadian government bonds. Or a month and year can be given for a specific contract, like ‘SXFZ07.MON’ for December 2007 S&P Canadian 60 futures.
Contracts and symbols can be found on the quotes page, see the “Stock Options and Futures Quotes” link under “Quick Links” at the right hand side of the home page.
Contract names are available in English and French, Chart follows the selected language (see Internationalization), or the default is English.
NZX provides
Quotes, historical data and other information is obtained from Yahoo (see Yahoo Finance).
The NZX web site is for non-commercial or personal use only, see the terms at
http://www.nzx.com/Contact_us/terms
In Chart NZX symbols follow the Yahoo convention, which is the exchange symbol and a ‘.NZ’ suffix, for example ‘TEL.NZ’ for Telecom New Zealand. The NZX home page above has a search to lookup symbols (as does Yahoo Finance).
The RBA provides
The RBA web site is for personal non-commercial use, with proper attribution. See the full terms at the following link. (It will be noted material is to be used in “unaltered form”, but the bank advises import into a charting program is permitted.)
http://www.rba.gov.au/Copyright/index.html
Available currencies can be found on the exchange rates page
http://www.rba.gov.au/Statistics/exchange_rates.html
In Chart RBA symbols are of the form ‘AUDXXX.RBA’ for the value of one Australian dollar in the currency ‘XXX’. Currently these are as follows
Symbol Currency AUDCNY.RBA Chinese renminbi AUDEUR.RBA Euro AUDJPY.RBA Japanese yen AUDHKD.RBA Hong Kong dollar AUDIDR.RBA Indonesian rupiah AUDMYR.RBA Malaysian ringgit AUDNZD.RBA New Zealand dollar AUDCHF.RBA Swiss franc AUDSGD.RBA Singapore dollar AUDKRW.RBA South Korean won AUDTWD.RBA Taiwanese dollar AUDGBP.RBA British pound sterling AUDUSD.RBA US dollar
Plus the RBA's Trade Weighted Index for the Australian dollar, and the Australian dollar valued in the IMF's Special Drawing Right basket of currencies.
Symbol Currency AUDTWI.RBA Trade Weighted Index AUDSDR.RBA Special Drawing Right
http://www.wtb-hannover.de/content/index_en.shtml?t2&en
RMX provides
Distribution or use of the web site contents is only allowed for private purposes, see the terms at
http://www.wtb-hannover.de/content/disclaimer/en/index.shtml?t5&en
In Chart RMX symbols have a ‘.WTB’ suffix, which is from when the exchange was called the Warenterminbörse Hannover (Commodity Exchange Hannover, WTB). The commodity code alone is the front month, like ‘LP.WTB’ for London potatoes. Or a specific month can be given, like ‘BX07.WTB’ for November 2007 brewing barley. Indices like ‘TAPX.WTB’ are also available.
The front month for hogs and piglets is without the week number, ie. ‘H.WTB’ and ‘F.WTB’, but a specific contract includes it, eg. ‘F5X07.WTB’ or ‘F3Z07.WTB’.
Contract codes and available months can be found by following the “Market” menu on the home page through to “Charts and Quotes”. Current commodities are
Code Commodity H
Hogs F
Piglets P
Table Potatoes XP
European Processing Potatoes LP
London Potatoes W
Wheat B
Brewing Barley
Current indices are as follows (though there seems to be no data for ‘TAPX.WTB’ and ‘POTX.WTB’),
PIGLETS.WTB TAPX.WTB POTX.WTB WTBBPC.WTB
Daily data is only available as graphs (GIF images), not as numbers, so WTB symbols cannot be added to the database. But those graphs can be viewed in Chart in the intraday window (see Intraday).
Contract names are available in English and German, Chart follows the selected language (see Internationalization), or the default is English.
SICOM provides
The website is for informational purposes only, see the disclaimer at
http://www.sicom.com.sg/index_sub.asp?content=disclaimer
In Chart SICOM symbols have a ‘.SICOM’ suffix. The commodity alone is the front month, like ‘RT.SICOM’ for RSS3 rubber. Or a month and year can be given, like ‘CF MAY 07.SICOM’ for May 2007 coffee. Or a quarter can be given, like ‘TF AMJ 07.SICOM’ for April/May/June 2007 TSR20 rubber (quarters are abbreviated to the three month letters).
Commodity symbols can be found on the contract specifications pages, see the links on the home page. Currently they are
Code Commodity CF
Robusta Coffee RS
RSS1 Rubber RT
RSS3 Rubber RI
RSS3 Rubber Index TF
TSR20 Rubber
There's no opening prices in the data, so candlestick figures cannot be drawn (see View Style).
The initial historical download is limited to 30 days, because each day is about 18 kbytes. Bear that in mind before doing a big “back to” download (see Download).
SFE provides
Information on the website is for non-commercial personal or educational purposes. See the main terms and disclaimer, and the further disclaimer at the bottom of each daily report,
http://www.sfe.com.au/index.html?content/aboutsfe/disclaimer.htm
http://www.sfe.com.au/content/sfe/marketdata/eod_sum.asp
The terms say information may not be modified, but SFE advises that importing quotes and data into a database or charting program is permitted.
In Chart SFE symbols have a ‘.SFE’ suffix. The commodity alone is the front month, like ‘XT.SFE’ for 10-year bonds. Or a month and year can be given, like ‘AP DEC 07.SFE’ for December 2007 SPI. Current contracts are shown in the daily reports,
http://www.sfe.com.au/content/sfe/marketdata/eod_sum.asp
These reports are used for the database, but quotes may not be available for some of the furthest months. In the “Quick Links” at the top right of the home page choose “Delayed Futures”, then “Delayed Futures” in the navigation bar at the right, and see the various product sections under that.
Only the past 5 days are available for download, but that can be accumulated over time. Graphs of the front month over the past year are available and can be viewed in the intraday window (see Intraday). There's no actual intraday graphs available.
A full list of commodities, including delisted ones, can be found at
http://www.sfe.com.au/site/commoditycodes.aspx
Commodities specified as trading on New Zealand time have that as their timezone (for the watchlist display), currently these are ‘BB’, ‘TN’, ‘TY’ and ‘ZI’. Everything else is Sydney.
TOCOM provides
All information is provided only for the purpose of explaining aspects of the exchange, see the terms at
http://www.tocom.or.jp/terms.html
There are no apparent contract symbols, so Chart uses the commodity name with a ‘.TOCOM’ suffix. The commodity alone is the front month, like ‘Crude Oil.TOCOM’. Or a particular month and year can be given, like ‘Rubber Aug 2007.TOCOM’.
Commodities and months can be found on the following quotes page, or individual commodities can be reached from the home page.
http://www.tocom.or.jp/souba/all/index.html
Historical data for 2004 and earlier is in zip format and Chart requires the unzip program to extract it. Ensure unzip is installed before downloading (see Installing).
http://www.tge.or.jp/english/index.shtml
TGE provides
The website is provided under the following disclaimer,
http://www.tge.or.jp/english/disclaimer/dis.shtml
In Chart TGE symbols have a ‘.TGE’ suffix. The commodity alone is the front month, like ‘CO.TGE’ for corn. Or a month and year can be given, like ‘RB JUN 07.TGE’ for June 2007 azuki (red beans).
Commodity symbols can be found in the price data under
http://www.tge.or.jp/english/price/pri_sel_01.shtml
Choose for instance “Soybean Meal”, “Download”, “Go”, and the symbol is the ‘SM’ in the filename sm01.csv. Current commodities are
Code Commodity CO
Corn SM
Soybean Meal SB
Soybean NG
Non-GMO Soybean RB
Azuki AC
Arabica Coffee RC
Robusta Coffee SG
Raw Sugar SL
Raw Silk VG
Vegetables
Available months (for all commodities) can be found on the quotes page
http://www.tge.or.jp/english/price/pri_all_01.shtml
Historical data is in zip format and Chart requires the unzip program to extract it. Ensure unzip is installed before downloading (see Installing).
Commodity names are available in English and Japanese, Chart follows the selected language (see Internationalization), or the default is English.
Yahoo provides the following for many stock exchanges around the world (see Yahoo Exchanges),
Yahoo does not allow commercial use, see the note at the bottom of the home page, and the terms of service at
http://docs.yahoo.com/info/terms/
Chart uses the Yahoo stock symbol conventions. For US stocks (AMEX, Nasdaq, NYSE) this is just the exchange symbol like ‘AAPL’ for Apple Computer. Stocks from elsewhere are the exchange symbol and a suffix, like ‘BMW.DE’ for BMW on Xetra. See Yahoo Exchanges, below, for those supported in Chart. Yahoo has a search at the following location (and at the country-specific sites),
http://finance.yahoo.com/lookup
Some currency cross-rates are available, they take a form such as ‘AUDUSD=X’ for the value of one Australian dollar in US dollars. Some spot metals prices are available in a similar form, for example ‘XAUUSD=X’ for Gold in US dollars. These may be just quotes, without historical data available.
It's not clear when new end-of-day data become available, sometimes it seems to be once the exchange opens for the following day, other times it seems further delayed. Chart will attempt to download after 10:30am the following trading day (in the exchange's timezone).
Dividends are updated weekly. They seem to be a bit patchy, with not all dividends actually appearing in the data for some stocks. The most recent dividend on the quotes pages is added to the database, so the latest should be available at least.
Historical data and intraday graphs always come from the main http://finance.yahoo.com site but quotes can be taken from the country-specific sites. It's not clear if this is an advantage, but you can try it if you want.
All sites give quotes for all worldwide stocks, though it's possible a few symbols might differ on the UK and European sites. The full list of sites is at the bottom of the Yahoo home page, but the only ones supported in Chart are those with commas in the “download data” and dividend dates in English. Currently this means the following (timezone names per the Olson database),
URL Timezone http://download.finance.yahoo.com America/New_York
http://au.finance.yahoo.com America/New_York
http://ca.finance.yahoo.com America/Vancouver
http://in.finance.yahoo.com America/New_York
http://sg.finance.yahoo.com America/New_York
http://uk.finance.yahoo.com Europe/London
Under Edit/Preferences in Chart you can set your nearest site and its timezone. The timezone is as you might set the TZ environment variable (see TZ Variable). If you have trouble finding a zone setting your system understands then at worst you should be able to set for example ‘BST-1’ for British Summer Time, 1 hour ahead of GMT (negatives are ahead), and remember to change it when daylight savings ends.
As shown in the table, the timezone is not necessarily the site's zone, which is a bit bizarre. If it's wrong then the quote times shown in the watchlist will be wrong, and even possibly the date of the latest drawn in the charts.
See also Australian Stock Exchange, and New Zealand Stock Exchange, which use Yahoo, and are described in their own sections.
Suffix Country Exchange
none USA American Stock Exchange (AMEX)
http://www.amex.comnone New York Stock Exchange (NYSE)
http://www.nyse.comnone NASDAQ
http://www.nasdaq.com‘.OB’ Over the Counter (OTC)
http://www.otcbb.com‘.PK’ Pink Sheets
http://www.pinksheets.com‘.BA’ Argentina Buenos Aires Stock Exchange (BCBA)
http://www.bcba.sba.com.ar‘.VI’ Austria Wiener Borse
http://www.wienerboerse.at/cms/2‘.SA’ Brazil Sao Paolo Stock Exchange
http://www.bovespa.com.br
‘.TO’ Canada Toronto Stock Exchange
http://www.tsx.com‘.V’ Toronto Stock Exchange Venture division
http://www.tsx.com‘.CO’ Denmark Copenhagen Stock Exchange
http://www.cse.dk‘.PA’ France Paris Stock Exchange (now part of Euronext)
http://www.euronext.com‘.BE’ Germany Berlin
http://www.berlinerboerse.de‘.BM’ Bremen
http://www.berlinerboerse.de‘.D’ Duesseldorf
http://www.boerse-duesseldorf.de‘.F’ Frankfurt ‘.H’ Hamburger Boerse
http://www.hamburger-boerse.de‘.HA’ Hanover ‘.MU’ Boerse Muenchen
http://www.boerse-muenchen.de‘.SG’ Stuttgart
http://www.boerse-stuttgart.de‘.DE’ XETRA ‘.HK’ Hong Kong Hong Kong Stock Exchange
http://www.hkex.com.hk‘.BO’ India Bombay Stock Exchange (BSE)
http://www.bseindia.com‘.CL’ Calcutta Stock Exchange (CSE)
http://www.cse-india.com‘.NS’ National Stock Exchange of India (NSE)
http://www.nseindia.com‘.JK’ Indonesia Jakarta Stock Exchange
http://www.jsx.co.id‘.MI’ Italy Italian Stock Exchange (Borsa Italiana)
http://www.borsaitaliana.it/homepage/homepage.en.htm‘.KS’ Korea Korean Stock Exchange
http://eng.krx.co.kr‘.KQ’ KOSDAQ
http://english.kosdaq.com‘.KL’ Malaysia Kuala Lumpur Stock Exchange (KLSE)
http://www.klse.com.my‘.MX’ Mexico Mexico Stock Exchange (Bolsa Mexicana de Valores)
http://www.bmv.com.mx‘.AS’ Netherlands Amsterdam Stock Exchange (now part of Euronext) http://www.euronext.com ‘.OL’ Norway Oslo Stock Exchange
http://www.oslobors.no/ob/?languageID=1
‘.SI’ Singapore Singapore Stock Exchange (SGX)
http://www.sgx.com
‘.BC’ Spain Barcelona Stock Exchange (Bolsa de Barcelona) http://www.borsabcn.es
‘.BI’ Bilbao Stock Exchange (Bolsa de Bilbao) http://www.bolsabilbao.es
‘.MA’ Madrid
‘.MC’ Madrid CATS
‘.MF’ Madrid fixed income
‘.ST’ Sweden Stockholm
‘.SW’ Switzerland Swiss Exchange (SWX)
http://www.swx.com
‘.VX’ Virt-X (part of the SWX Group)
http://www.virt-x.com
‘.TW’ Taiwan Taiwan Stock Exchange
http://www.tse.com.tw/docs/eng_home.htm
‘.TWO’ Taiwan OTC
‘.L’ UK London Stock Exchange (LSE)
http://www.londonstockexchange.com
‘.IL’ London Stock Exchange International Order Book (IOB)
http://www.londonstockexchange.com/en-gb/products/membershiptrading/tradingservices/internationalorderbook.htm
ZSE provides
All material is for personal non-commercial use only, see the “Terms of Use” link at the bottom of the home page.
In Chart ZSE symbols have a ‘.ZAG’ suffix, or example ‘PLVA-R-A.ZAG’ for PLIVA d.d. Symbols can be found under the “Listings” link on the home page.
There's no opening prices in the data, so candlestick figures cannot be drawn. If candlesticks are selected the display falls back to OHLC figures instead (see View Style).
It's not clear when the day's prices become available, currently Chart is setup to try after midnight (Central European time).
Chart is written in English, but has support for various localizations, selected by the usual system mechanisms.
On a typical Unix/POSIX-style system the locale is selected with the LANG environment variable, set to a language code and optional territory and charset. For example US English,
LANG=en_US export LANG
This is often set by the system administrator, but you can do it yourself in ~/.profile (see Bash Startup Files).
Language and country codes can be found in Language Codes, and Country Codes. Usually there's only a few combinations available on a system, run ‘locale -a’ to see them.
Additionally, on a GNU system the LANGUAGE environment variable gives a
list of language preferences for message translations (see User influence on gettext
). For example to have Italian preferred, otherwise Spanish,
otherwise English,
LANGUAGE=it_IT:es:en export LANGUAGE
Chart looks at LANGUAGE too (on all systems) for the preferred language for stock and commodity names.
chart.el is an Emacs interface (see The Emacs Editor) to Chart quotes and the watchlist. It's designed for Emacs 21, but also works with XEmacs 21 if you have the UTF-8 charset (see below).
The Chart GUI is the main interface to Chart, but chart.el offers various features without leaving Emacs, and they work on a text mode terminal too (where the Chart GUI cannot run).
The best way to use chart.el is with autoloads for the commands. chart-autoloads.el is a small file which sets this up, you can add the following to your .emacs file (see The Init File ~/.emacs),
(require 'chart-autoloads)
If Chart isn't installed in a standard location you'll need to add its lisp
directory ($prefix/share/emacs/site-lisp) to your Emacs
load-path
(see Libraries of Lisp Code for Emacs).
M-x chart-watchlist displays the favourites list in a buffer. <a> adds a symbol. C-k and C-y kill and yank symbols. <g> refreshes the quotes. <L> selects a different list (like the alerts list). The usual C-h m mode help shows other key bindings.
Chart communicates changes to the favourites list between the Emacs display and a running Chart GUI. So if you've got both open then changes in one are immediately reflected in the other.
M-x chart-quote displays a quote for a given symbol in the message area. It prompts for the symbol, the default is a symbol at point. <Tab> completion is available (see Completion) using the database symbols, favourites list, and previously requested symbols, but anything can be entered.
M-x chart-quote-at-point displays a quote for the symbol at point, without prompting.
The language, date formats, etc follow the Chart locale selection described in Internationalization. Emacs M-x set-language-environment and other Emacs setups don't influence the display.
Return the latest price for symbol (a string) from Chart. If there's no information available (an unknown stock, not online, nothing cached, or whatever) the return is
nil
.(chart-latest "GM") ⇒ 19.55field is a lisp symbol for what data to return. The default is
last
which is the last price. Other possibilities are:name
,bid
,offer
,open
,high
,low
,change
,volume
,decimals
,note
. Which fields actually have data depends on the data source.(chart-latest "GM" 'volume) ⇒ 10492900The scale argument is a power of 10 to apply to prices. For example if scale is 2 then a price 2.75 is returned as 275. This can be useful for instance if you want to work in cents but quotes are in dollars. The default is 0, for no scaling, giving the usual units of the source.
field
decimals
is how many decimal places Chart is using for prices internally. Internally prices are kept as an integer with a count of decimals. Using this value for scale will ensure an integer return.field
name
is the stock or commodity name as a string (ornil
if not available).(chart-latest "BHP.AX" 'name) ⇒ "BHP BILLITON LIMITED"field
note
is a string with extra notes, such as ex-dividend or limit up, ornil
if nothing.
A call
(thing-at-point 'chart-symbol)
gives the Chart symbol at point (seething-at-point
). Note that you must(require 'chart)
before using this, it's not autoloaded.
chart-latest
above can be used in SES (see SES: Simple Emacs Spreadsheet) to get prices for a portfolio etc. An example.ses
spreadsheet showing this is included in the Chart sources.
M-x chart-ses-refresh downloads new prices for any chart-latest
usage in a SES spreadsheet, and recalculates with those (see ses-recalculate-all
). The required symbols are found by tracing the calls to
chart-latest
, so those calls can be in any sort of complicated formula
or conditional.
UTF-8 is used when communicating with Emacs, the same as the Gtk GUI display. This is easiest to implement, and it should mean whatever is seen in the GUI can be seen in Emacs.
If you use an Asian locale then you probably know Emacs 21 has limited support for Asian UTF-8 characters. The typical symptom is seeing ‘\207’, ‘\221’ or similar instead of proper characters. You can install the MULE-UCS package to extend the builtin character sets (see References).
If you use XEmacs 21 you probably know it has no UTF-8 at all. To use
chart.el
you must get one of the add-ons which provide that charset.
MULE-UCS is recommended.
chart-devel.el has some setups for writing Chart code, in particular
scheme-mode
indentation for various Chart and Guile Gtk functions.
chart-devel.el can be used with the following in your .emacs,
(add-hook 'scheme-mode-hook (lambda () (require 'chart-devel)))
You'll need to know a bit about Guile and Guile Gtk to make additions to Chart. Guile and Scheme is quite easy to learn, especially just enough to do a few small things. An introduction can be found in the Guile Tutorial.
Some customizations are as simple as a one-line addition to your ~/Chart/init.scm or ~/Chart/gui.scm. Examples are given with the relevant Chart function and variable documentation.
At startup the file ~/Chart/init.scm is loaded. This is done in all cases, including when running a script with ‘-s’ or for the non-graphical ‘--download’.
init.scm should be used for low-level customizations or non-GUI additions. This includes new data sources or indicators.
When starting the normal graphical interface, the file ~/Chart/gui.scm is loaded, after all initial widgets have been created, but not yet realized (ie. the windows are not yet displayed). This can be used for GUI additions and customizations.
init.scm is still loaded when starting the GUI, it's loaded first then later gui.scm is loaded.
You can write a stand-alone script using Chart functions by running with the ‘-s’ option. For example,
chart -s myscript.scm
On a Unix/POSIX-like system you can start a script with the #!
mechanism, so it becomes a program run directly. The suggested intro is
#!/bin/sh exec chart -s "$0" "$@" !# ... Scheme code using chart ...
The ~/Chart user directory is added to the load path, as a convenient place to put extra modules, private to each user. For example if you create a new indicator module ~/Chart/mystuff/super-indicator.scm, then init.scm or other code can access it with
(use-modules (mystuff super-indicator))
Modules can of course also be installed under the usual Guile site directory (/usr/share/guile/site or wherever), but an ordinary user normally doesn't have permissions for that.
The
GnomeApp
widget (emulated usingGtkWindow
) which is the main Chart window.The default size is 9/10 of the screen. This can be customized in gui.scm with for instance,
;; width and height in pixels (gtk-window-set-default-size app-widget 700 500)The window manager will generally add its decoration on top of the requested size.
This is the
GtkMenuBar
across the top of the main window.Extra things can be added to the menus. The clock module (clock.scm) is a (fairly) simple example of doing that, it puts a clock at the right of the menubar. Enable it by adding the following to your ~/Chart/gui.scm,
(use-modules (chart clock)) (clock-in-menubar)
The
GnomeAppBar
(emulated using Gtk) status widget across the bottom of the main window.
Popup the chart open dialog. This function is used for the File/Open menu item.
Open the Chart manual in a viewer, at the start at the manual by default, or with a node argument (a string) at that node or anchor.
This function implements the Help/Manual menu item, and the various dialog Help buttons (with various a node arguments).
The Gnome gconf handler for
ghelp:
is used, or the gnome-help (Yelp) browser directly, or otherwise an ordinary HTML browser from the BROWSER environment variable or from among some likely candidates.
manual-popup
can be changed to invoke some other help display if desired. For instance the following in gui.scm opens the manual in Emacs through gnuserv (see References),(define (my-gnuclient-eval str) (system (format #f "gnuclient -batch -eval '~a'" str))) (define (my-gnuclient-info-goto-node node) (my-gnuclient-eval (format #f "(Info-goto-node \"(chart)~a\")" (or node "Top")))) (set! chart-manual my-gnuclient-info-goto-node)
The definitions in this section are available from
(use-modules (chart toolbar))
The
GtkToolBar
across the top of the main window. This is only created (and added to the display) when the(chart toolbar)
module is used. There's an autoload oftoolbar-widget
for the convenience of code in gui.scm.The toolbar can be oriented vertically with the following code in gui.scm.
(gtk-object-set toolbar-widget #:orientation 'vertical)Buttons can be added to it in the Gtk style, for example to open a browser on a favourite news site,
(let ((button (gtk-button-new-with-label "News"))) (gtk-signal-connect button "activate" (lambda () (gnome-url-show "http://some-stock-news-site.com"))) (gtk-toolbar-append-widget toolbar-widget button "Browse some news site" ;; tooltip ""))
Scroll the chart left, right, up or down, by a step, a page, or to the end. These are the functions used for the arrow keys and <Page-Up> and <Page-Down> keys.
Forcibly redraw the display. Normally this is unnecessary. This is the function used by <Control-L>.
Step to the next, or previous, chart. The are the functions used by the File/Next and File/Prev menu entries.
Step to the first entry in the next or previous symbol list.
Display the chart of symbol, which is a string, or
#f
to clear the display.
Dates are handled as integers counting from a particular point. Dates prior to those points are supported, they're simply negative values. This is fast and compact, and can index into an array of data. The timebases described below are provided, for days (trading days), weeks, calendar months, etc.
The ymd
functions take or return a year as a full 4 digit value
(eg. 2006), a month 1 to 12, and a day 1 to 31 (or whatever the month goes
up to).
An “adate” is all days, numbered starting from 0 on Monday 5 Jan 1970.
A “tdate” is a trading day, ie. a weekday. Tdates are numbered starting from 0 on Monday 5 Jan 1970.
Return the tdate for the given year, month and day. If that day is on a weekend, the tdate for the previous Friday is returned.
Return the tdate of today (or Friday on a weekend). The optional zone is a timezone name to use (a string).
A “wdate” is a trading week. Wdates are numbered starting from 0 for the week beginning Monday 5 Jan 1970.
Return the wdate containing the given year, month and day. If the given date is a weekend, the prior week is returned.
An “mdate” is a calendar month. Mdates are numbered starting from 0 for January 1970.
Return a list
(
year month day)
for mdate m. The day returned is always 1, even if that's not a trading day.
Return the mdate containing the given year, month and day. (The day parameter is unused, it exists only for compatibility with other
ymd->Xdate
functions.)
A “qdate” is a calendar quarter. Qdates are numbered starting from 0 for the quarter January to March 1970.
A year is represented as a full 4-digit number, eg. 2006.
A “ddate” is a calendar decade, as the year divided by 10, eg. 200 for the decade 2000 to 2009.
Return the series symbol, as a string, or
#f
if no derived from any symbol.
Return the series name, as a UTF-8 string, or
#f
if none.When the symbol is already a full name, like ‘ALUMINIUM ALLOY.LME’, there's no further name and
series-name
gives#f
.series-symbol
can be used in that case.Derived series set the name to the base name (or symbol) and a descriptive addition, like ‘ - Weekly’ for
series-convert-timebase
(see below) converting to weekly.
Return the number of decimals in the series values. For example if decimals is 2 then a value 1259 means 12.59.
The database is kept with enough decimals that prices for a stock are integers. This ensures there's no rounding, and will usually reflect the minimum price fluctuation allowed by the exchange.
A derived series like a moving average can have floating point values.
series-decimals
still applies in that case.
Return an array with the series data, for date range lo to hi (inclusive).
Series arrays operate “on-demand”. Only as much as is needed will be calculated or read from disk, etc. Each call to
series-array
might return the same array object, or it might be a new array. Either way the return is good for the requested lo to hi.
Return the dividends in series, in the form of an alist
(
date.
value)
. The dates are in the series timebase.values are currently in three forms
- A free-form string.
- A list
(month
mdate)
for a rollover of a futures front month.- A list
(split
newnum oldnum)
for a stock split.
Return the lowest and highest dates (in the
series-timebase
and inclusive) available in series.
Return the parent series from which series is derived, or
#f
if series is not derived.
Return a new series which is series converted to the given to-timebase. This can be used for instance to collapse daily data to monthly data.
Because weeks and months don't fall on the same boundaries, a monthly series should be derived from daily data, rather than going daily to weekly then to monthly. Likewise quarters, years and decades should not go via weeks.
The functions in this section are in
(use-modules (chart view))
Set the series to display in view. All affected widgets are redrawn.
The heading widget is shown above the main graph. The functions in this section are in
(use-modules (chart heading))
An alist of timebase and
strftime
format string used by the defaultheading-string
above. This can be customized to change just the date formatting. For example “month day, year” style,(assq-set! heading-string-alist timebase-days "to %a %b %d, %Y")
“Latest” price data is the most recent day's open, high, low and last trade prices, and the current bid/offer quote.
Latest data is cached (under ~/Chart/cache/latest), so it's still available when offline, but it's otherwise regarded as transient and not accumulated. The most recent day in the database is also used when nothing better is available, but symbols don't have to be in the database to retrieve or use latest data.
The functions in this section are in
(use-modules (chart latest))
Latest data is held in a record. The following functions access the fields of such a record.
The number of decimal places on prices in latest. For example if
latest-decimals
is 2 then a price ‘1250’ means ‘12.50’.
Price and volume for trading on the indicated adate (see Date Functions).
latest-last-time
is the time of the last trade (seconds since midnight).
latest-change
is the difference betweenlatest-last
and the preceding day's closing price (or settlement price).Any of these fields can be
#f
when information is not available. (Though if there's a value forlatest-last-time
then there's also one forlatest-last-adate
.)
Bid/offer prices, and the adate and time (seconds since midnight) they're from.
Any of these can be
#f
if not available or if there's no bid or offer at all currently.
The mdate of the contract month, or
#f
for stocks.For symbols which are a specific month, like ‘CLZ07.NYMEX’, this is the same as encoded in the symbol. But for a symbol which is the current front month, like ‘CL.NYMEX’,
latest-contract-mdate
shows which month that actually is.
A short note about the data as a UTF-8 string, or
#f
. This is used for various things, like a stock gone ex-dividend, or futures at limit up or down.
Return a latest record for symbol. This only gets data already downloaded (into the latest record cache, or the database), it doesn't make a new query (see below for that).
Request latest data for symbol-list, and perhaps some of extra-list if they can be retrieved at the same time for no extra cost.
Both of these functions return immediately. When the request is completed (successfully or not)
latest-update-hook
is run.For some data sources with compact formats (like Yahoo) it's as fast to ask for perhaps 10 prices as it is to ask for 1. extra-list pads out a small request, but if there's no room then it's ignored.
latest-request-symbols
is for general display, it treats a latest record up to 2 minutes old as adequate.latest-request-explicit
is for an explicit user request to get latest data, it always re-downloads.
A hook (see Hook Reference) which is run when new latest price data is available.
Each hook procedure is called as
(proc
symbol-list)
where symbol-list is a list of symbols with new latest data. A hook procedure can get the data withlatest-get
, for those it's interested in.
latest-update-hook
is run when data is downloaded by the current Chart process, and also when another Chart process on the same machine has downloaded new data.
The database stores historical price/volume data and extra information like dividends, currency, etc. The functions in this section are in
(use-modules (chart database)
Return a series which is symbol read from the database. If symbol doesn't exist then return
#f
.Series are cached in memory and
database-read-series
will return a cached series object if the data on disk is unchanged.
Delete each given symbols (zero or more arguments) from the database. Both the downloaded data and any manually entered annotations (see Annotations) are deleted.
The functions in this section are provided by
(use-modules (chart download))
Download data for all the stock symbols in lst (a list of strings).
The default is to download an update, ie. the latest available data, or an initial 5 years data. The
#:backto
option asks instead to download data back to the given tdate (see Date Functions).
This function is the core of both the --download command-line option (see Invocation) and the download dialog (see Download). It can be used in Scheme code to download programmatically, either as an alternative to a shell script or to make some sophisticated symbol selections. A simple example,
#!/bin/sh exec chart -s "$0" "$@" !# (download #:symbols '("^GSPC" "MNG.CAS" "GM")) (exit 0)
Downloading is done symbol by symbol in the order specified, except that all symbols for a particular data source are done at once. In the example above, ‘^GSPC’ is from Yahoo (see Yahoo Finance) so having decided to do Yahoo first all later symbols from there are picked out, in this case ‘GM’ is done ahead of ‘MNG.CAS’.
That sort of reordering can be avoided by making multiple download
calls, but usually it's best to ask for big blocks of symbols together, since
some sources can combine HTTP requests for multiple symbols.
Return the decimal point string or thousands separator string, obtained from current locale settings, as UTF-8 strings.
The default “C” locale has no thousands separator. You can override just this using for example the following in your ~/Chart/init.scm,
(set! locale-thousands-sep (lambda () ","))
Return the date format string (as UTF-8), for use with
strftime
(see Formatting Calendar Time), obtained from current locale settings. The default “C” locale is normally US style"%m/%d/%y"
.You can set a personal preference in your ~/Chart/init.scm, for example “25-Jan-06” style,
(set! locale-d-fmt (lambda () "%d-%b-%y"))
Return str converted from UTF-8 to the locale charset.
Characters from str which don't exist in the locale charset are converted to question marks ‘?’. This ensures any string can be displayed, at least partially.
The functions in this section are provided by
(use-modules (chart http))
Make a HTTP request to retrieve url and return two values (see Multiple Values), the headers and the body, both as strings.
(receive (headers body) (http-request "http://www.somewebsite.com/index.html") ...)The headers are exactly as received from the server, including CRLF line endings. The various
http-headers
functions below can examine them. A simple headers string might beHTTP/1.0 200 Ok\r\n Content-Length: 123\r\n \r\nBy default the response status code is not examined, that's left to the caller (see
http-headers-status-code
below). But if called with#:want-ok #t
then an error is thrown for anything except “ok” (response codes 200 through 299).(receive (headers body) (http-request "http://www.somegoodsite.com/index.html" #:want-ok #t) ...)Data compression (gzip or compress) is automatically requested when the necessary decompression (gzip or Zlib) is available. The body data is decompressed before it's returned, making any transfer compression transparent to the application. (The
Content-Encoding
line remains in the headers though.)By default 301 and 302 redirection responses are followed and the new URL from the server is retrieved (up to a limit of 5 follows).
#:follow #f
can be passed to disable this. When disabled a 301 or 302 counts as “ok” for the purposes of#:want-ok
.
#:method "XXX"
sets the method (a string) in the request. The default is the usual"GET"
, but for instance"HEAD"
can be used just to enquire about the document without retrieving it (in that case the body will be an empty string).
#:data
is used with a"POST"
method, giving the data to be posted (often values from a HTML form).I/O errors from
connect
etc such as network unreachable are thrown in the usual Guile system call fashion. HTTP protocol errors, including timeouts, are thrown with ahttp
key. For example(throw 'http "Timeout")
Return the status code (an integer) from a headers string.
(http-headers-status-code "HTTP/1.0 200 Ok\r\nContent-Length: 123\r\n\r\n") ⇒ 200
Return true if status-code (an integer) represents an "ok" response from the server. This means a number in the range 200 to 299 (inclusive).
(http-status-code-ok? 404) ⇒ #f (http-status-code-ok? 200) ⇒ non-#f
Return true if headers (a string) represents an "ok" response from the server. This is a simple combination of
http-headers-status-code
andhttp-status-code-ok?
.
Look in headers for the given name (a string) header field and return its value as a string, or
#f
if not present.Leading and trailing whitespace on the value is deleted, and if the value continues over multiple lines the CRLFs in it are removed (but not the whitespace at the start of each continuation).
(http-headers-get headers "ETag") ⇒ "some server id 12345"The name given is not case sensitive (as per RFC 2068).
The functions in this section are available from
(use-modules (chart gzip))
Return the gzip program version string, for example
"1.3.12"
, or if not available then return#f
.
STR is a string of compressed data, in either gzip (.gz) or compress (.Z) format. Uncompress it and return the result. An error is thrown if the data in str is invalid or inconsistent.
The functions in this section are available from
(use-modules (chart unzip))
Return the unzip program version string, for example
"5.52"
, of it not available then return#f
.
STR is a .zip file in a string. Uncompress it and return the result as a string. An error is thrown if the data in str is invalid or inconsistent. If there's multiple files in the str contents, then all are extracted and concatenated together for the result.
The functions in this section are available from
(use-modules (chart zlib))
Return the Zlib version string, as obtained from the
zlibVersion
library function (not merely the headers compiled against). If Zlib was not compiled into Chart then this function still exists, but returns#f
.
STR is a string of compressed data in either zlib (RFC 1950) or gzip (RFC 1952, .gz) format. Uncompress it and return the result. An error is thrown if the data in str is invalid or inconsistent. This function only exists when Zlib is compiled into Chart (see Installing).
Chart runs in three modes: as a single thread, as a cooperative multi-tasking non-GUI main loop, or cooperative multi-tasking under the Gtk main loop.
For Gtk operation, the normal gtk-main
is not used, but instead calls
to gtk-main-iteration
are made and any calls to the trampoline
(see Gtk Extras) are queued to be run outside
gtk-main-iteration
. This allows callbacks to capture continuations
(see Continuations) and resume them
later, such as when input is available or whatever. Such continuations are
used for coroutine multi-threading.
The main effect of deferring callbacks is that the actual return value to Gtk
is always #f
. This means an idle handler or timer runs once-only, and
an X event always propagates to further handlers (which is normally what's
wanted).
The following three functions can be used in all modes.
Wait until there are no other inputs, and no other coroutines waiting at a higher priority.
priority is an integer as per Gtk/Glib idle handlers, which means smaller values are higher priority. The default is
gtk-priority-default
, which is 200.
Wait until one of the conditions in conds is satisfied on port. conds is a list of one or more of the symbols (Scheme symbols)
read
andwrite
.
Wait until one of the conditions in conds is satisfied on port, or until secs many seconds have elapsed. The return is
#t
if conds is satisfied, or#f
if it timed out. conds is a list of one or more of the symbols (Scheme symbols)read
andwrite
.
The following are used in the multi-tasking modes,
Queue a call
(
proc arg...)
to be made at a future time by the main loop.
The directory containing per-user config files, notes, etc. This is the ~/Chart directory, ie. the Chart subdirectory in the user's home directory.
The home directory is taken from the HOME environment variable, or from the system /etc/passwd file. On a non-Unix/POSIX system, setting
HOME
will be essential.It's not possible to customize
chart-user-directory
, since this is the place where init.scm customizations themselves are sought!
Weblinks are URLs for company information pages, commodity contract specifications, etc. They're shown in the GUI under the View/Web menu, and in the watchlist per-line menu.
Register proc as a weblink handler for symbols passing pred. pred is either a function to be called
(
predsymbol)
, or a string suffix like".FOO"
. For matching symbols proc is called as(
procsymbol)
and should return a list of three strings(name tooltip url)name is a UTF-8 string for the menu entry, optionally with a ‘_’ mnemonic. tooltip is a UTF-8 string to show as the tooltip when the mouse hovers over the menu entry, or
#f
if no tooltip is wanted. url is the URL to goto in a browser when the menu entry is selected.A simple handler just going to a fixed page would be
(weblink-handler! ".L" (lambda (symbol) (list "Yahoo Finance _UK" "Go to the Yahoo Finance UK home page." "http://uk.finance.yahoo.com")))Or one based on the symbol could be
(use-modules (chart munich)) (weblink-handler! munich-symbol? (lambda (symbol) (list "Some _News" "Go to Some News Site profile for this company." (string-append "http://somenewssite.de/profile.html?sym=" (chart-symbol-sans-dot symbol)))))The url in the list can also be a procedure to be called
(
urlproc)
returning a URL string. This can be used if some extra downloading is needed to get the URL, such as a set of ID numbers to go in the URL. The user can be told how that's progressing with the following message function,— Function: weblink-message fmt [arg...]
Print a message about dynamic weblink generation. fmt and optional args are as per
simple-format
(see Writing). In the GUI the message is shown in the message area at the bottom of the main window.The url returned in the list can also be
#f
to show a menu entry, but as “insensitive”. This can be used when a data source normally has such a link, but for a few symbols it's not available. If url is a procedure, that procedure likewise can return#f
instead of a URL string, if it finds there's nothing available for the particular symbol.
This module is some simple routines for terminal control using the curses library (see man curses or man ncurses), or the tput program. The functions in this section are available from
(use-modules (chart curses))
This is only for adding bits of colour or highlighting to reports on a text mode terminal, not for a large scale text mode application. See man 5 terminfo for possible control strings, though which ones are actually available will depend on the terminal.
The terminal must be on a file port and must be used directly. It's generally not possible to capture a string and send it later, because curses may insert baud-rate dependent time delays into the sequences for some terminals, which a replayed string would not contain.
Initialize the curses library for output to a terminal of type term (a string) on the current output port. The default is the TERM environment variable.
The
tput
functions below automatically callsetupterm
(with no argument), so there's no need to call it explicitly unless a special term is required.setupterm
can be called again to change to a different terminal type if desired.
Print a curses control string for capability cap (a string) to the current output port. arg is an optional integer argument, for those cap capabilities which require an argument. For example,
(tput "bold") (display "this is bold\n") (tput "sgr0") (display "this is normal again\n")If cap is known and supported by the terminal, the return is true (non-
#f
), if not the return is#f
. What actually comes out of course depends on the terminal. For instance underline might be the same as bold.The port line/column (see Reading) is not changed. This suits character attribute changes, but not cursor movement commands like
"cuf1"
.
Print a curses control string on the current output port, selecting the given colour. colour must be one of the following symbols (Scheme symbols)
red
,green
,yellow
,blue
,magenta
,cyan
andwhite
. For example(tput-colour 'red)There are two colour commands in curses, ‘setaf’ and ‘setf’.
tput-colour
uses ‘setaf’ if available, otherwise ‘setf’. If neither is supported thentput-colour
does nothing.On a PC,
yellow
in normal brightness is more like brown. Adding(tput "bold")
gives a proper yellow.
In the GUI errors reported in a dialog, with a backtrace if run with --debug, and the program continues. An error in the command-line downloading stops that source, and others continue.
An error while drawing can be bad, because each time the dialog is dismissed the area under it is redrawn, provoking the error again. This should be rare, and hopefully related only to a particular symbol's data.
It's not an error if a data source is offline, that's just reported as a download message or in the note of a latest record. But unexpected data contents will generally cause an error. An effort has been made to ensure changed web site formats aren't silently ignored (or misinterpreted).
The devel directory in the sources has some code for printing traces (among other things).
Chart can use a HTTP proxy when downloading. The following semi-standard environment variables are recognised.
http_proxy=http://proxy.myisp.com.au:8080/
Currently there's no support for proxies requiring a username/password
authorization.
no_proxy=myisp.com.au,www.mynet:8080
Since Chart only accesses distant servers, no_proxy
is unlikely to be
applicable.
If special proxy settings are required just for Chart, a putenv
or
unsetenv
can be added to your ~/Chart/init.scm (see Runtime Environment). For example,
(putenv "http_proxy=http://proxy.myisp.com.au:8080/")
No proxy is used with https
secure HTTP requests (for data sources
using that protocol).
bash_completion
, command line completions for many programs. #!
: Extending.AS
: Yahoo Exchanges.ATH
: Athens Stock Exchange.AX
: Australian Stock Exchange.BA
: Yahoo Exchanges.BC
: Yahoo Exchanges.BE
: Yahoo Exchanges.BEN
: Bendigo Stock Exchange.BI
: Yahoo Exchanges.BM
: Yahoo Exchanges.BO
: Yahoo Exchanges.CAS
: Casablanca Stock Exchange.CBOT
: Barchart.CCOM
: Central Japan Commodity Exchange.CL
: Yahoo Exchanges.CME
: Barchart.CO
: Yahoo Exchanges.COMEX
: Barchart.D
: Yahoo Exchanges.DE
: Yahoo Exchanges.F
: Yahoo Exchanges.GHA
: Ghana Stock Exchange.H
: Yahoo Exchanges.HA
: Yahoo Exchanges.HK
: Yahoo Exchanges.IL
: Yahoo Exchanges.JK
: Yahoo Exchanges.KCBT
: Kansas City Board of Trade.KEX
: Kansai Commodities Exchange.KL
: Yahoo Exchanges.KQ
: Yahoo Exchanges.KS
: Yahoo Exchanges.L
: Yahoo Exchanges.LJ
: Ljubljana Stock Exchange.LME
: London Metal Exchange.MA
: Yahoo Exchanges.MC
: Yahoo Exchanges.MF
: Yahoo Exchanges.MGEX
: Minneapolis Grain Exchange.MI
: Yahoo Exchanges.MLC
: MLC Funds.MON
: Montreal Exchange.MU
: Yahoo Exchanges.MX
: Yahoo Exchanges.NS
: Yahoo Exchanges.NYBOT
: Barchart.NYMEX
: Barchart.NZ
: New Zealand Stock Exchange.OB
: Yahoo Exchanges.OL
: Yahoo Exchanges.PA
: Yahoo Exchanges.PK
: Yahoo Exchanges.SA
: Yahoo Exchanges.SFE
: Sydney Futures Exchange.SG
: Yahoo Exchanges.SI
: Yahoo Exchanges.SICOM
: Singapore Commodities Exchange.SIMEX
: Barchart.ST
: Yahoo Exchanges.SW
: Yahoo Exchanges.TA
: Yahoo Exchanges.TGE
: Tokyo Grain Exchange.TOCOM
: Tokyo Commodities Exchange.TW
: Yahoo Exchanges.TWO
: Yahoo Exchanges.V
: Yahoo Exchanges.VI
: Yahoo Exchanges.VX
: Yahoo Exchanges.WTB
: Risk Management Exchange.ZAG
: Zagreb Stock Exchangeadate
: Date Functionsbarchart.com
: Barchartbash_completion
: Referencesbash_completion
: Invocationddate
: Date Functionsfloat.com.au
: Floatgconf
: Widgetsghelp
: Widgetshttps
: London Metal Exchangehttps
: Installingiconv
: Referencesload-path
: Emacsqdate
: Date Functionssite-lisp
: Emacstdate
: Date Functionsthing-at-point
: Emacswdate
: Date Functions(chart clock)
: Widgets(chart curses)
: Curses Module(chart database)
: Database Functions(chart download)
: Download Functions(chart gzip)
: Data Crunching Functions(chart heading)
: Graph Functions(chart http)
: HTTP Functions(chart latest)
: Latest Quote Functions(chart unzip)
: Data Crunching Functions(chart view)
: Graph Functions(chart zlib)
: Data Crunching Functionsadate->ymd
: Date Functionsapp-widget
: Widgetsappbar-widget
: Widgetsc-idle
: Main Loopc-input-timeout-wait
: Main Loopc-input-wait
: Main Loopc-main-enq!
: Main Loopchart-first
: Movement Functionschart-last
: Movement Functionschart-latest
: Emacschart-next
: Movement Functionschart-next-list
: Movement Functionschart-open
: Movement Functionschart-prev
: Movement Functionschart-prev-list
: Movement Functionschart-quote
: Emacschart-quote-at-point
: Emacschart-redraw
: Movement Functionschart-ses-refresh
: Emacschart-user-directory
: Miscellaneous Functionschart-version
: Miscellaneous Functionschart-watchlist
: Emacsclock-in-menubar
: Widgetsdatabase-delete
: Database Functionsdatabase-read-series
: Database Functionsdatabase-symbol?
: Database Functionsdatabase-symbols
: Database Functionsdownload
: Download Functionsgunzip-string
: Data Crunching Functionsgzip-version
: Data Crunching Functionsheading-string-alist
: Graph Functionshttp-headers-get
: HTTP Functionshttp-headers-ok?
: HTTP Functionshttp-headers-status-code
: HTTP Functionshttp-request
: HTTP Functionshttp-status-code-ok?
: HTTP Functionslatest-bid
: Latest Quote Functionslatest-change
: Latest Quote Functionslatest-contract-mdate
: Latest Quote Functionslatest-decimals
: Latest Quote Functionslatest-get
: Latest Quote Functionslatest-high
: Latest Quote Functionslatest-last
: Latest Quote Functionslatest-last-adate
: Latest Quote Functionslatest-last-time
: Latest Quote Functionslatest-low
: Latest Quote Functionslatest-name
: Latest Quote Functionslatest-note
: Latest Quote Functionslatest-offer
: Latest Quote Functionslatest-open
: Latest Quote Functionslatest-quote-adate
: Latest Quote Functionslatest-quote-time
: Latest Quote Functionslatest-request-explicit
: Latest Quote Functionslatest-request-symbols
: Latest Quote Functionslatest-symbol
: Latest Quote Functionslatest-update-hook
: Latest Quote Functionslatest-volume
: Latest Quote Functionslocale->utf8
: Localization Functionslocale-d-fmt
: Localization Functionslocale-decimal-point
: Localization Functionslocale-thousands-sep
: Localization Functionsmanual-popup
: Widgetsmdate->ymd
: Date Functionsmenubar-widget
: Widgetsopen-dialog-popup
: Widgetsscroll-end-left
: Movement Functionsscroll-end-right
: Movement Functionsscroll-page-down
: Movement Functionsscroll-page-left
: Movement Functionsscroll-page-right
: Movement Functionsscroll-page-up
: Movement Functionsscroll-step-down
: Movement Functionsscroll-step-left
: Movement Functionsscroll-step-right
: Movement Functionsscroll-step-up
: Movement Functionsseries-array
: Series Functionsseries-convert-timebase
: Series Functionsseries-decimals
: Series Functionsseries-dividends
: Series Functionsseries-hi
: Series Functionsseries-lo
: Series Functionsseries-name
: Series Functionsseries-parent
: Series Functionsseries-symbol
: Series Functionsseries-timebase
: Series Functionssetupterm
: Curses Moduletdate->ymd
: Date Functionstdate-today
: Date Functionstimebase-days
: Date Functionstimebase-decades
: Date Functionstimebase-months
: Date Functionstimebase-quarters
: Date Functionstimebase-weeks
: Date Functionstimebase-years
: Date Functionstoolbar-widget
: Widgetstput
: Curses Moduletput-colour
: Curses Moduleunzip-string
: Data Crunching Functionsunzip-version
: Data Crunching Functionsutf8->locale
: Localization Functionsview-series
: Graph Functionsview-series!
: Graph Functionswdate->ymd
: Date Functionsweblink-handler!
: Miscellaneous Functionsweblink-message
: Miscellaneous Functionsymd->adate
: Date Functionsymd->mdate
: Date Functionsymd->tdate
: Date Functionsymd->wdate
: Date Functionszlib-inflate
: Data Crunching Functionszlib-version
: Data Crunching Functions[1] Their book The New Technical Trader, 1984.
[2] First published in Barrons magazine in 1962.
[3] Rating Trend Strength, Technical Analysis of Stocks and Commodities magazine, 11:9 (382-386)
[4] The True Strength Index, Technical Analysis of Stocks and Commodities magazine, November 1991.