view release on metacpan or search on metacpan
doc/chart.texi view on Meta::CPAN
@end tex
@ifnottex
@example
REMA - REMAprev
RegMom = ---------------
REMAprev
@end example
@end ifnottex
This is like a Rate of Change (@pxref{Momentum and Rate of Change}), but on
just one day and as a fraction instead of a percentage. A crossing through
zero of the RegMom is a peak or trough (and possibly just a flat spot before a
further rise or fall in the REMA line).
@subsection Additional Resources
@itemize
@item
@uref{http://www.traders.com/Documentation/FEEDbk_docs/Archive/072003/TradersTips/TradersTips.html}
-- TASC Traders' Tips, August 2003, REMA and REMA momentum formulas.
@end itemize
doc/chart.texi view on Meta::CPAN
@c ---------------------------------------------------------------------------
@node Aroon, Average True Range, Accumulative Swing Index, Indicators
@section Aroon
@cindex Aroon
@cindex Chande, Tushar
The Aroon indicator by Tushar Chande shows the length of time since the
highest or lowest close among the past N days' closes. There are three lines:
Aroon Up for the high, Aroon Down for the low, and the Aroon Oscillator.
Aroon Up and Down are both expressed as percentages 0 to 100. If today is a
new N-day high then Aroon Up is 100, and for each day that passes (without a
fresh N-day high) it drops by 100/N, down to 0 for no new highs in the past N
days. Conversely for Aroon Down for new N-day lows.
The Aroon Oscillator is simply the difference between the Up and Down lines,
@tex
$$ AroonOsc = AroonUp - AroonDown $$
@end tex
@ifnottex
doc/chart.texi view on Meta::CPAN
instance), then just close-to-close changes are used. This may be of limited
use.
@cindex Normalized ATR
@anchor{Normalized ATR}
@subsection Normalized ATR
@cindex Forman, John
The normalized ATR by John Forman
(@uref{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.
@tex
$$ NATR = 100 \times { ATR \over close } $$
@end tex
@ifnottex
@example
ATR
NATR = 100 * -----
doc/chart.texi view on Meta::CPAN
@c ---------------------------------------------------------------------------
@node Directional Movement Index, Ease of Movement, Detrended Price Oscillator, Indicators
@section Directional Movement Index
@cindex Directional movement index
@cindex DMI
@cindex Wilder, J. Welles
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 (@pxref{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 (@pxref{Exponential Moving Average}) and expressed as a percentage of
average true range (@pxref{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-.
@tex
$$ DI+ = 100 \times { EMA[N] \, of \, DM+ \over ATR[N] } \;\;\;\;\;
DI- = 100 \times { EMA[N] \, of \, DM- \over ATR[N] } $$
@end tex
@ifnottex
@example
doc/chart.texi view on Meta::CPAN
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.
@cindex Average directional index
@cindex ADX
@anchor{Average Directional Index}
@subsection Average Directional Index
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,
@tex
$$ ADX = 100 \times { |DI+ - DI-| \over DI+ + DI- } $$
@end tex
@ifnottex
@example
abs(DI+ - DI-)
ADX = 100 * --------------
DI+ + DI-
doc/chart.texi view on Meta::CPAN
@node Forecast Oscillator, Gopalakrishnan Range Index, Force Index, Indicators
@section Forecast Oscillator
@cindex Forecast oscillator
@cindex Oscillator, forecast
@cindex FOSC
@cindex %F
@cindex Chande, Tushar
The %F forecast oscillator by Tushar Chande shows deviation between today's
closing price and an N-day linear regression forecast (@pxref{Linear
Regression}) of that close. The deviation is expressed as a percentage of the
close, so the formula is
@tex
$$ \%F = { close - forecast \over close } \times 100 $$
$$ forecast = linear \; regression \; of \; previous \; N days,
\; at \; today $$
@end tex
@ifnottex
@example
close - forecast
doc/chart.texi view on Meta::CPAN
@c ---------------------------------------------------------------------------
@node Intraday Momentum Index, Klinger Volume Oscillator, Gopalakrishnan Range Index, Indicators
@section Intraday Momentum Index
@cindex Intraday momentum index
@cindex Index, Intraday momentum
@cindex IMI
@cindex Chande, Tushar
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).
@tex
$$ IMI = { Sum[N]\;of\; \max(close-open, 0)
\over Sum[N]\;of\; |close-open| } $$
@end tex
@ifnottex
@example
Sum[N] of max(close-open, 0)
IMI = ----------------------------
doc/chart.texi view on Meta::CPAN
@c ---------------------------------------------------------------------------
@node Momentum and Rate of Change, Money Flow Index, MASS Index, Indicators
@section Momentum
@cindex Momentum
@cindex Rate of change
@cindex ROC
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 @ms{p,1} is today,
@ms{p,2} yesterday, etc, then
@tex
$$ Momentum = p_1 - p_{N+1} $$
$$ ROC = 100 \; {p_1 - p_{N+1} \over p_{N+1}} $$
@end tex
@ifnottex
@example
doc/chart.texi view on Meta::CPAN
@c ---------------------------------------------------------------------------
@node Money Flow Index, On-Balance Volume, Momentum and Rate of Change, Indicators
@section Money Flow Index
@cindex Money Flow Index
@cindex MFI
@cindex Index, money flow
The Money Flow Index (MFI) ranges 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 past 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,
@tex
$$ typical\ price = {high + low + close \over 3} $$
@end tex
@ifnottex
doc/chart.texi view on Meta::CPAN
/ close
| ----------- if vol > vol[prev]
PVI = PVI[prev] * | close[prev]
|
\ 1 if vol <= vol[prev]
@end example
@end ifnottex
The fraction @m{close/close_{prev}, close/close[prev]} means that the indices
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
the start is 100 for 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.
@c FIXME Such an average can be viewed in
@c Chart by selecting an SMA (@pxref{Simple Moving Average}) of 260 days (one
doc/chart.texi view on Meta::CPAN
@node Polarized Fractal Efficiency, Pretty Good Oscillator, Negative Volume Index, Indicators
@section Polarized Fractal Efficiency
@cindex Polarized fractal efficiency
@cindex PFE
@cindex Fractal, polarized efficiency indicator
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 @ms{p,1} (today) to @ms{p,N} is
@tex
$$ PFE = { \mathop{\rm Hypot} (N-1, \; \mathop{\rm Pchg}(p_1,p_N))
\over { \mathop{\rm Hypot} (1, \; \mathop{\rm Pchg}(p_1,p_2))
+ \cdots
+ \mathop{\rm Hypot} (1, \; \mathop{\rm Pchg}(p_{N-1},p_N)) }} $$
$$ \mathop{\rm Sign}(x) = 1 \; if \; X>0; \; or \; -1 \; if \; X<0 $$
$$ \mathop{\rm Pchg}(new,old) = 100 \times { new - old \over old } $$
$$ \mathop{\rm Hypot}(x,y) = \sqrt{x^2 + y^2} $$
doc/chart.texi view on Meta::CPAN
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)
@end example
@end ifnottex
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),
doc/chart.texi view on Meta::CPAN
@c ---------------------------------------------------------------------------
@node Price and Volume Trend, QStick, Pretty Good Oscillator, Indicators
@section Price and Volume Trend
@cindex Price and volume trend
@cindex PVT
@cindex Volume, price trend
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.
@tex
$$ PVT = PVT_{prev} + volume \times
{ close_{today} - close_{prev} \over close_{prev} } $$
@end tex
@ifnottex
@example
close[today] - close[yesterday]
PVT = PVTprev + volume * -------------------------------
doc/chart.texi view on Meta::CPAN
@c Moving Average}) on the raw values, and that can be shown in Chart the same as
@c any average on an indicator (@pxref{View Style}).
@c ---------------------------------------------------------------------------
@node RAVI, Relative Strength Index, R-Squared Index, Indicators
@section RAVI
@cindex RAVI
RAVI is a simple indicator showing whether a stock is trending. It calculates
the percentage difference between current prices and older prices. Current
prices are represented by a short SMA and the longer time frame by a long SMA
(@pxref{Simple Moving Average}). The defaults are 7 days and 65 days.
@tex
$$ RAVI = 100 \times { | SMA[short] - SMA[long] | \over SMA[long] }$$
@end tex
@ifnottex
@example
abs (SMA[short] - SMA[long])
RAVI = 100 * ----------------------------
doc/chart.texi view on Meta::CPAN
@cindex Stochastics
@cindex Lane, George
Stochastics are an oscillator and signal line described by George Lane based
on each day's close within the total trading range of past N days. This
should not be confused with stochastic processes etc in mathematics, the two
are unrelated.
@cindex %K stochastic
The %K line is the close position within the past N-days trading range
(highest high to lowest low) expressed as a percentage 0 to 100.
@tex
$$ \%K = 100 \times {{close - Nday\;low} \over Nday\;high - Nday\;low } $$
@end tex
@ifnottex
@example
close - Nday low
%K = 100 * --------------------
Nday high - Nday low
@end example
doc/chart.texi view on Meta::CPAN
@ifnottex
@example
up = / close - average if close > average
\ 0 otherwise
down = / average - close if average < close
\ 0 otherwise
@end example
@end ifnottex
The percentage of the total up amounts out of total up and down amounts is
then the trend intensity index,
@tex
$$ RVIorig = 100 \times { total \; up
\over total \; up + total \; down } $$
@end tex
@ifnottex
@example
total up
TDI = 100 * ---------------------
doc/chart.texi view on Meta::CPAN
moving average for an RSI.
@c ---------------------------------------------------------------------------
@node TRIX, Twiggs Money Flow, True Strength Index, Indicators
@section TRIX
@cindex TRIX
@cindex Hutson, Jack
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 smoothed EMA values.
@tex
$$ TRIX = 100 \times { EMAofEMAofEMA[today] - EMAofEMAofEMA[yesterday]
\over EMAofEMAofEMA[yesterday] } $$
@end tex
@ifnottex
@example
EMAofEMAofEMA[today] - EMAofEMAofEMA[yesterday]
TRIX = 100 * ---------------------------------------
doc/chart.texi view on Meta::CPAN
@node Ulcer Index, Ultimate Oscillator, Twiggs Money Flow, Indicators
@section Ulcer Index
@cindex Ulcer index
@cindex Index, Ulcer
@uref{http://www.tangotools.com/ui/ui.htm}
@cindex Martin, Peter
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 close a retracement percentage is calculated, relative to the highest
close so far.
@tex
$$ R_i = 100 \times { price_i - maxprice\,so\,far \over maxprice\,so\,far } $$
@end tex
@ifnottex
@example
price[i] - maxprice so far
R[i] = --------------------------
maxprice so far
doc/chart.texi view on Meta::CPAN
@end tex
@ifnottex
@example
bp1 + bp2 + ... + bp7
avg7 = ---------------------
tr1 + tr2 + ... + tr7
@end example
@end ifnottex
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.
@tex
$$ UltOsc = 100 \times {4 \times avg_7 + 2 \times avg_{14} + avg_{28}
\over 4 + 2 + 1 } $$
@end tex
@ifnottex
@example
4 * avg7 + 2 * avg14 + avg28
UltOsc = 100 * ----------------------------
4 + 2 + 1
doc/chart.texi view on Meta::CPAN
In Chart it's merely the segment of data first displayed.
@c ---------------------------------------------------------------------------
@node Zig Zag Indicator, , Williams Accumulation/Distribution, Indicators
@section Zig Zag Indicator
@cindex Zig zag indicator
@cindex Indicator, zig zag
The zig zag indicator is a simple way to ignore retracements less than a given
X percentage.
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 that latest high is
penetrated. Then a down line is drawn, it in turn continuing until a reversal
of more than X% above the last lowe 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
lib/App/Chart/Series/Derived/ADX.pm view on Meta::CPAN
# http://www.stockcharts.com/education/IndicatorAnalysis/indic_ADX.html
sub longname { __('ADX - Average Directional Index') }
sub shortname { __('ADX') }
sub manual { __p('manual-node','Average Directional Index') }
use constant
{ type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
};
sub parameter_info {
return [ { name => __('Days'),
key => 'adx_days',
type => 'float',
minimum => 1,
default => 14,
decimals => 0,
lib/App/Chart/Series/Derived/CMO.pm view on Meta::CPAN
#
sub longname { __('CMO - Chande Momentum Oscillator') }
sub shortname { __('CMO') }
sub manual { __p('manual-node','Chande Momentum Oscillator') }
use constant
{ hlines => [ -50, 50 ],
type => 'indicator',
units => 'percentage_plus_or_minus_100',
minimum => -100,
maximum => 100,
parameter_info => [ { name => __('Days'),
key => 'cmo_days',
type => 'integer',
minimum => 1,
default => 14 } ],
};
sub new {
lib/App/Chart/Series/Derived/Coppock.pm view on Meta::CPAN
use base 'App::Chart::Series::Indicator';
use App::Chart::Series::Derived::ROC;
use App::Chart::Series::Derived::WMA;
sub longname { __('Coppock Curve') }
sub shortname { __('Coppock') }
sub manual { __p('manual-node','Coppock Curve') }
use constant
{ type => 'indicator',
units => 'roc_percent',
hlines => [ 0 ],
parameter_info => App::Chart::Series::Derived::Momentum::parameter_info(),
};
my $N1 = 11;
my $N2 = 14;
my $smooth = 10;
sub new {
my ($class, $parent) = @_;
lib/App/Chart/Series/Derived/FOSC.pm view on Meta::CPAN
# Trading system by Steve Karnish.
#
sub longname { __('Forecast Oscillator %F') }
sub shortname { __('FOSC') }
sub manual { __p('manual-node','Forecast Oscillator') }
use constant
{ type => 'indicator',
units => 'roc_percent',
priority => -10,
hlines => [ 0 ],
minimum => 0,
parameter_info => [ { name => __('Days'),
key => 'forecastosc_days',
type => 'integer',
minimum => 1,
default => 5 } ],
};
lib/App/Chart/Series/Derived/IMI.pm view on Meta::CPAN
#
# http://www.fmlabs.com/reference/IMI.htm
# Formula, brief description.
sub longname { __('IMI - Intraday Momentum Index') }
sub shortname { __('IMI') }
sub manual { __p('manual-node','Intraday Momentum Index') }
use constant
{ type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
hlines => [ 30, 70 ],
parameter_info => [ { name => __('Days'),
key => 'imi_days',
type => 'integer',
minimum => 1,
default => 14 } ],
};
lib/App/Chart/Series/Derived/Inertia.pm view on Meta::CPAN
# Dorsey TASC 1995 for sale.
#
sub longname { __('Inertia (smoothed RVI)') }
sub shortname { __('Inertia') }
sub manual { __p('manual-node','Inertia') }
use constant
{ hlines => [ 40, 50, 60 ],
type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
parameter_info => [ { name => __('Stddev Days'),
key => 'rvi_stddev_days', # per RVI.pm
type => 'integer',
minimum => 1,
default => 10 },
{ name => __('Smooth Days'),
key => 'rvi_smooth_days', # per RVI.pm
type => 'float',
lib/App/Chart/Series/Derived/MFI.pm view on Meta::CPAN
# pos+neg MF
sub longname { __('MFI - Money Flow Index') }
sub shortname { __('MFI') }
sub manual { __p('manual-node','Money Flow Index') }
use constant
{ type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
hlines => [ 20, 80 ],
parameter_info => [ { name => __('Days'),
key => 'mfi_days',
type => 'integer',
minimum => 1,
default => 14 } ],
};
lib/App/Chart/Series/Derived/NATR.pm view on Meta::CPAN
# John Forman's web site.
#
sub longname { __('NATR - Normalized ATR') }
sub shortname { __('NATR') }
sub manual { __p('manual-node','Normalized ATR') }
use constant
{ type => 'indicator',
units => 'natr', # percentage, but only a small one
minimum => 0,
parameter_info => [ { name => __('Days'),
key => 'atr_days', # shared with ATR.pm
type => 'integer',
minimum => 1,
default => 14 } ],
};
sub new {
my ($class, $parent, $N) = @_;
lib/App/Chart/Series/Derived/PFE.pm view on Meta::CPAN
# http://trader.online.pl/MSZ/e-w-Polarized_Fractal_Efficiency.html
# Mov(If(C, >, Ref(C,-9),
# Sqr(Pwr(Roc(C,9,$),2) + Pwr(10,2))
# / Sum(Sqr( Pwr(Roc(C,1,$),2) + 1), 9),
# -Sqr(Pwr(Roc(C,9,$),2) + Pwr(10,2))
# / Sum(Sqr( Pwr(Roc(C,1,$),2) + 1), 9))
# *100, 5, E)
#
# http://www.traderslog.com/polarized-fractal-efficiency.htm
# Sample chart of IBM from 2002. Year not shown, but data is 2002.
# Seems based on ROC as percentage, day step as 1 in hypot, and 5-day
# EMA smooth.
#
# http://store.traders.com/-v12-c01-polariz-pdf.html
# TASC article for sale.
#
sub longname { __('PFE - Polarized Fractal Efficiency') }
sub shortname { __('PFE') }
sub manual { __p('manual-node','Polarized Fractal Efficiency') }
use constant
{ type => 'indicator',
units => 'percentage_plus_or_minus_100',
minimum => -100,
maximum => 100,
hlines => [ 0 ],
parameter_info => [ { name => __('Days'),
key => 'pfe_days',
type => 'integer',
minimum => 1,
default => 10 },
{ name => __('Smooth'),
key => 'pfe_smooth_days',
lib/App/Chart/Series/Derived/QStick.pm view on Meta::CPAN
# http://trader.online.pl/MSZ/e-w-Chandes_QStick.html
#
sub longname { __('QStick') }
*shortname = \&longname;
sub manual { __p('manual-node','QStick') }
use constant
{ type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
hlines => [ 0 ],
parameter_info => [ { name => __('Days'),
key => 'qstick_days',
type => 'integer',
minimum => 1,
default => 8 } ],
};
lib/App/Chart/Series/Derived/ROC.pm view on Meta::CPAN
use base 'App::Chart::Series::Indicator';
use App::Chart::Series::Derived::Momentum;
sub longname { __('ROC - Rate of Change') }
sub shortname { __('ROC') }
sub manual { __p('manual-node','Momentum and Rate of Change') }
use constant
{ type => 'indicator',
units => 'roc_percent',
hlines => [ 0 ],
parameter_info => App::Chart::Series::Derived::Momentum::parameter_info(),
};
sub new {
my ($class, $parent, $N) = @_;
return $class->SUPER::new
(parent => $parent,
N => $N,
lib/App/Chart/Series/Derived/RSI.pm view on Meta::CPAN
# Numerical examples, graph of DELL.
#
sub longname { __('RSI - Relative Strength Index') }
sub shortname { __('RSI') }
sub manual { __p('manual-node','Relative Strength Index') }
use constant
{ hlines => [ 30, 50, 70 ],
type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
parameter_info => [ { name => __('Days'),
key => 'rsi_days',
type => 'float',
minimum => 1,
default => 14,
decimals => 0,
step => 1 } ],
};
lib/App/Chart/Series/Derived/RVI.pm view on Meta::CPAN
# TASC traders tips for sale.
#
sub longname { __('RVI - Relative Volatility Index') }
sub shortname { __('RVI') }
sub manual { __p('manual-node','Relative Volatility Index') }
use constant
{ hlines => [ 40, 50, 60 ],
type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
parameter_info => [ { name => __('Stddev Days'),
key => 'rvi_stddev_days',
type => 'integer',
minimum => 1,
default => 10 },
{ name => __('Smooth Days'),
key => 'rvi_smooth_days',
type => 'float',
lib/App/Chart/Series/Derived/Stochastics.pm view on Meta::CPAN
use App::Chart::Series::Derived::SMA;
use App::Chart::Series::Derived::WilliamsR;
sub longname { __('Stochastics %K/%D') }
sub shortname { __('%R') }
sub manual { __p('manual-node','Stochastics') }
use constant
{ type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
hlines => [ 20, 80 ],
parameter_info => [ { name => __('%K Days'),
key => 'stochastics_K_days',
type => 'integer',
minimum => 1,
default => 14 },
{ name => __('%D Days'),
key => 'stochastics_D_days',
lib/App/Chart/Series/Derived/TDREI.pm view on Meta::CPAN
# not shown, looks like 5 days.
#
sub longname { __('TD REI - Range Expansion Index') }
sub shortname { __('TDREI') }
sub manual { __p('manual-node','TD Range Expansion Index') }
use constant
{ hlines => [ -40, 45 ],
type => 'indicator',
units => 'percentage_plus_or_minus_100',
minimum => -100,
maximum => 100,
parameter_info => [ { name => __('Stddev Days'),
key => 'tdrei_days',
type => 'integer',
minimum => 1,
default => 5 }],
};
sub new {
lib/App/Chart/Series/Derived/TII.pm view on Meta::CPAN
#
sub longname { __('TII - Trend Intensity Index') }
sub shortname { __('TII') }
sub manual { __p('manual-node','Trend Intensity Index') }
use constant
{ hlines => [ 20, 50, 80 ],
type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
parameter_info => [ { name => __('MA Days'),
key => 'tii_ma_days',
type => 'integer',
minimum => 1,
default => 60 },
{ name => __('Dev Days'),
key => 'tii_dev_days',
type => 'integer',
lib/App/Chart/Series/Derived/TSI.pm view on Meta::CPAN
# http://www.traders.com/Documentation/FEEDbk_docs/Archive/112005/Letters/Letters.html
# TASC letters Nov 2005, Perry Kaufman giving formula.
#
# http://www.linnsoft.com/tour/techind/tsi.htm
# Formula, parameters 9 and 3, sample intraday AOL.
#
# http://www.meta-formula.com/Metastock-Formulas-T.html
# Formula.
#
# http://trader.online.pl/MSZ/e-w-True_Strength_Index.html
# Formula with ROC percentage and programmable period.
# http://trader.online.pl/MSZ/e-w-True_Strength_Index_II.html
# Formula, plain mom, periods 25 and 13.
# http://trader.online.pl/MSZ/e-w-True_Strength_Index_III.html
# Formula, plain momentum, periods 15 and 5.
# http://trader.online.pl/MSZ/e-w-True_Strength_Index_IV.html
# Formula, plain momentum, periods 25 and 13.
# http://trader.online.pl/MSZ/e-w-True_Strength_Index_V.html
# Formula, showing EMA periods 40 and 20, sample on WIG20.
#
# http://www.fmlabs.com/reference/default.htm?url=TSI.htm
lib/App/Chart/Series/Derived/TSI.pm view on Meta::CPAN
#
sub longname { __('TSI - True Strength Index') }
sub shortname { __('TSI') }
sub manual { __p('manual-node','True Strength Index') }
use constant
{ hlines => [ -25, 25 ],
type => 'indicator',
units => 'percentage_plus_or_minus_100',
minimum => -100,
maximum => 100,
parameter_info => [ { name => __('EMA-1 Days'),
key => 'tsi_ema1_days',
type => 'float',
minimum => 1,
default => 25,
decimals => 0,
step => 1 },
{ name => __('EMA-2 Days'),
lib/App/Chart/Series/Derived/Ulcer.pm view on Meta::CPAN
# the calculation, not of whole period.
#
sub longname { __('Ulcer Index') }
sub shortname { __('Ulcer') }
sub manual { __p('manual-node','Ulcer Index') }
use constant
{ type => 'indicator',
units => 'percentage',
minimum => 0,
parameter_info => [ { name => __('Days'),
key => 'ulcer_days',
type => 'integer',
minimum => 1,
# don't know a good default, this is arbitrary
default => 60 }],
};
sub new {
lib/App/Chart/Series/Derived/Ulcer.pm view on Meta::CPAN
sub ulcer_on_aref {
my ($aref) = @_;
if (@$aref <= 1) { return 0; }
my $high = $aref->[-1];
my $sumsq = 0;
for (my $i = $#$aref - 1; $i >= 0; $i--) {
my $value = $aref->[$i];
if ($value >= $high) {
$high = $value;
} elsif ($high != 0) {
# percent decline
$sumsq += (100 * ($high - $value) / $high) ** 2;
}
}
return sqrt ($sumsq / scalar @$aref);
}
sub proc {
my ($class_or_self, $N) = @_;
my @array;
lib/App/Chart/Series/Derived/Ultimate.pm view on Meta::CPAN
# http://www.stockcharts.com/education/IndicatorAnalysis/indic_ultimate.html
sub longname { __('Ultimate Oscillator') }
sub shortname { __('Ultimate') }
sub manual { __p('manual-node','Ultimate Oscillator') }
use constant
{ type => 'indicator',
units => 'percentage',
minimum => 0,
maximum => 100,
hlines => [ 30, 50, 70 ],
parameter_info => [ { name => __('Days'),
key => 'williams_r_days',
type => 'integer',
minimum => 1,
default => 10 } ],
};
lib/App/Chart/Series/Derived/WilliamsR.pm view on Meta::CPAN
use base 'App::Chart::Series::Indicator';
use App::Chart::Series::Derived::SMA;
sub longname { __('Williams %R') }
sub shortname { __('%R') }
sub manual { __p('manual-node','Williams %R') }
use constant
{ type => 'indicator',
units => 'negative_percentage',
minimum => -100,
maximum => 0,
hlines => [-20, -80],
parameter_info => [ { name => __('Days'),
key => 'williams_r_days',
type => 'integer',
minimum => 1,
default => 10 } ],
};
lib/App/Chart/Series/Derived/ZigZag.pm view on Meta::CPAN
# http://stockcharts.com/education/IndicatorAnalysis/indic_ZigZag.html
# Sample HPQ chart 1999/2000.
sub longname { __('Zig Zag') }
*shortname = \&longname;
sub manual { __p('manual-node','Zig Zag Indicator') }
use constant
{ type => 'average',
parameter_info => [ { name => __('% Change'),
key => 'zigzag_percent',
type => 'float',
type_hint => 'percent',
minimum => 0,
default => 5,
step => 1 },
{ name => __('Closes'),
key => 'zigzag_closes',
type => 'boolean',
default => 0 },
],
# default_linestyle => 'ZigZag',
line_colours => { values => 'solid' },
};
sub new {
my ($class, $parent, $percent, $closes_flag) = @_;
return $class->SUPER::new
(parent => $parent,
parameters => [ $percent, $closes_flag ],
arrays => { values => [] },
array_aliases => { });
}
# This does the whole series from start to end. It might be possible to
# work back looking for a PERCENT move which would establish the direction
# and hence a starting point in the middle of the data.
#
sub fill {
my ($self, $lo, $hi) = @_;
if ($self->{'filled'}) { return; }
$self->{'filled'} = 1;
my $parent = $self->{'parent'};
my ($percent, $closes_flag) = @{$self->{'parameters'}};
$hi = $self->hi;
$parent->fill (0, $hi);
my $p = $parent->values_array;
my $ph = $closes_flag ? $p : $parent->array('highs');
my $pl = $closes_flag ? $p : $parent->array('lows');
my $s = $self->values_array;
my $factor_increase = 1 + $percent / 100;
my $factor_decrease = 1 / $factor_increase;
my $direction = sub {};
my $extreme;
my $target;
my $extreme_pos;
my ($rising, $falling);
$rising = sub {
my ($pos, $high, $low) = @_;
if (! defined $extreme || $high > $extreme) {
lib/App/Chart/Series/Indicator.pm view on Meta::CPAN
my $parameter_info = $self->parameter_info;
my @parameters;
foreach my $i (0 .. $#$parameters) {
my $pinfo = $parameter_info->[$i];
if ($pinfo->{'type'} eq 'boolean') {
$parameters[$i] = ($parameters->[$i] ? $pinfo->{'name'} : '');
} elsif ($pinfo->{'type'} eq 'float') {
# display just 1 decimal is that's enough
my $nf = App::Chart::number_formatter();
my $value = $parameters->[$i];
my $percent = $pinfo->{'type_hint'}//'' eq 'percent';
my $decimals = max ($pinfo->{'decimals'} // 0,
App::Chart::count_decimals($value));
$parameters[$i] = $nf->format_number ($value, $decimals, 1);
if ($percent) {
$parameters[$i] .= '%';
}
} else {
$parameters[$i] = $parameters->[$i];
}
}
$parameters = join (__p('separator',',') . ' ', @parameters);
$name = join (' ', $name, $parameters);
}
my $parent_name = $self->parent->name;
lib/App/Chart/Suffix/LJ.pm view on Meta::CPAN
foreach my $line (split /\n+/, $content) {
my $elem;
if ($line =~ /^ 0010 /) {
# index
$L0010 ||= make_parser (code => 4,
symbol => 8,
name => 40,
close => '15.',
change => '15.',
percent_change => '15.');
$elem = $L0010->($line);
$elem->{'symbol'} = '^' . $elem->{'symbol'};
} elsif ($line =~ /^ 0020 /) {
# stock
$L0020 ||= make_parser (code => 4,
tier => 4,
type => 4,
symbol => 8,
isin => 20,
name => 40,
dividend => '15.',
note_num => 10,
average_price => '15.',
change => '15.',
percent_change => '15.',
last_date => 10,
bid => '15.',
offer => '15.',
high => '15.',
low => '15.',
open => '15.',
close => '15.',
volume => 12,
volume_offmarket => 12,
turnover => 12,
turnover_bas => 12,
IF_1 => 15,
IF_2 => 15,
IF_percent => 15,
note => 10,
shares_issued => 12,
dividend_date => 10,
p_e => 10,
principle => 20,
interest => 20,
coupon_num => 5,
market_discount => 15,
name_and_city => 80,
trading_mode => 5,
lib/App/Chart/Suffix/LJ.pm view on Meta::CPAN
}
}
if ($elem) {
$elem->{'symbol'} .= '.LJ';
# as of May 2007 the change field is empty, but the change % field is
# supplied
if ($elem->{'close'} ne ''
&& exists $elem->{'change'} && $elem->{'change'} eq '') {
$elem->{'change'} = percent_change_to_change
($elem->{'close'}, $elem->{'percent_change'});
}
push @data, { %$elem };
}
}
return $h;
}
sub make_parser {
my @desc = @_;
my @field_list;
lib/App/Chart/Suffix/LJ.pm view on Meta::CPAN
# pick out the "0002" trading day from a .txt file
sub txt_to_date {
my ($content) = @_;
$content =~ /^ 0002 ([0-9][0-9])\.([0-9][0-9])\.([0-9][0-9][0-9][0-9]) /m
or die 'Ljubljana: txt file missing 0002 date line';
return "$3-$2-$1";
}
# VALUE is a string like "1234.50" which is a latest index value, and
# change-% is a string like "-0.09" which is a percentage change from the
# previous index value. Return a change amount as a string in points
# instead of percentage.
#
sub percent_change_to_change {
my ($value, $percent_change) = @_;
my $decimals = App::Chart::count_decimals ($value);
# value = prev * (1 + change%/100)
# so prev = value * 100/(100+change%)
# want change = value - prev
# which is change = value * (1 - 100/(100+change%))
# = value * -change% / (100+change%)
# = value * change% / (100+change%)
#
return sprintf '%.*f', $decimals,
$value * $percent_change / ($percent_change + 100);
}
#-----------------------------------------------------------------------------
# download - individual
#
# This uses the data archives at
#
# http://www.ljse.si/cgi-bin/jve.cgi?doc=2069
#
lib/App/Chart/doc/chart.html view on Meta::CPAN
<p>A momentum indicator is formed from REMA as the slope of the line from
yesterday’s REMA to today’s.
</p>
<div class="example">
<pre class="example-preformatted"> REMA - REMAprev
RegMom = ---------------
REMAprev
</pre></div>
<p>This is like a Rate of Change (see <a class="pxref" href="#Momentum-and-Rate-of-Change">Momentum</a>), but on
just one day and as a fraction instead of a percentage. A crossing through
zero of the RegMom is a peak or trough (and possibly just a flat spot before a
further rise or fall in the REMA line).
</p>
</div>
<div class="subsection-level-extent" id="Additional-Resources-3">
<h4 class="subsection"><span>8.14.2 Additional Resources<a class="copiable-link" href="#Additional-Resources-3"> ¶</a></span></h4>
<ul class="itemize mark-bullet">
<li><a class="uref" href="http://www.traders.com/Documentation/FEEDbk_docs/Archive/072003/TradersTips/TradersTips.html">http://www.traders.com/Documentation/FEEDbk_docs/Archive/072003/TradersTips/TradersTips.html</a>
– TASC Traders’ Tips, August 2003, REMA and REMA momentum formulas.
</li></ul>
lib/App/Chart/doc/chart.html view on Meta::CPAN
Next: <a href="#Average-True-Range" accesskey="n" rel="next">Average True Range</a>, Previous: <a href="#Accumulative-Swing-Index" accesskey="p" rel="prev">Accumulative Swing Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="Aroon-1"><span>10.3 Aroon<a class="copiable-link" href="#Aroon-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Aroon"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-1"></a>
<p>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.
</p>
<p>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.
</p>
<p>The Aroon Oscillator is simply the difference between the Up and Down lines,
</p>
<div class="example">
<pre class="example-preformatted">AroonOsc = AroonUp - AroonDown
</pre></div>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<a class="index-entry-id" id="index-Normalized-ATR"></a>
<a class="anchor" id="Normalized-ATR"></a><ul class="mini-toc">
<li><a href="#Normalized-ATR-1" accesskey="1">Normalized ATR</a></li>
</ul>
<div class="subsection-level-extent" id="Normalized-ATR-1">
<h4 class="subsection"><span>10.4.1 Normalized ATR<a class="copiable-link" href="#Normalized-ATR-1"> ¶</a></span></h4>
<a class="index-entry-id" id="index-Forman_002c-John"></a>
<p>The normalized ATR by John Forman
(<a class="uref" href="http://www.theessentialsoftrading.com">http://www.theessentialsoftrading.com</a>) 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.
</p>
<div class="example">
<pre class="example-preformatted"> ATR
NATR = 100 * -----
close
</pre></div>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<div class="nav-panel">
<p>
Next: <a href="#Ease-of-Movement" accesskey="n" rel="next">Ease of Movement</a>, Previous: <a href="#Detrended-Price-Oscillator" accesskey="p" rel="prev">Detrended Price Oscillator</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> ...
</div>
<h3 class="section" id="Directional-Movement-Index-1"><span>10.12 Directional Movement Index<a class="copiable-link" href="#Directional-Movement-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Directional-movement-index"></a>
<a class="index-entry-id" id="index-DMI"></a>
<a class="index-entry-id" id="index-Wilder_002c-J_002e-Welles-4"></a>
<p>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 <a class="pxref" href="#True-Range">True Range</a>).
</p>
<p>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.
</p>
<p>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.
</p>
<p>The two DM+ and DM- series are each smoothed with an N-day exponential moving
average (see <a class="pxref" href="#Exponential-Moving-Average">Exponential Moving Average</a>) and expressed as a percentage of
average true range (see <a class="pxref" href="#Average-True-Range">Average True Range</a>). The ATR uses the same N-day
EMA smoothing. Two lines are formed, the upwards directional index DI+ and
downwards directional index DI-.
</p>
<div class="example">
<pre class="example-preformatted"> EMA[N] of DM+ EMA[N] of DM+
DI+ = 100 * ------------- DI+ = 100 * -------------
ATR[N] ATR[N]
</pre></div>
lib/App/Chart/doc/chart.html view on Meta::CPAN
</p>
<a class="index-entry-id" id="index-Average-directional-index"></a>
<a class="index-entry-id" id="index-ADX"></a>
<a class="anchor" id="Average-Directional-Index"></a><ul class="mini-toc">
<li><a href="#Average-Directional-Index-1" accesskey="1">Average Directional Index</a></li>
</ul>
<div class="subsection-level-extent" id="Average-Directional-Index-1">
<h4 class="subsection"><span>10.12.1 Average Directional Index<a class="copiable-link" href="#Average-Directional-Index-1"> ¶</a></span></h4>
<p>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,
</p>
<div class="example">
<pre class="example-preformatted"> abs(DI+ - DI-)
ADX = 100 * --------------
DI+ + DI-
</pre></div>
<hr>
lib/App/Chart/doc/chart.html view on Meta::CPAN
Next: <a href="#Gopalakrishnan-Range-Index" accesskey="n" rel="next">Gopalakrishnan Range Index</a>, Previous: <a href="#Force-Index" accesskey="p" rel="prev">Force Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a...
</div>
<h3 class="section" id="Forecast-Oscillator-1"><span>10.17 Forecast Oscillator<a class="copiable-link" href="#Forecast-Oscillator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Forecast-oscillator"></a>
<a class="index-entry-id" id="index-Oscillator_002c-forecast"></a>
<a class="index-entry-id" id="index-FOSC"></a>
<a class="index-entry-id" id="index-_0025F-1"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-3"></a>
<p>The %F forecast oscillator by Tushar Chande shows deviation between today’s
closing price and an N-day linear regression forecast (see <a class="pxref" href="#Linear-Regression">Linear Regression</a>) of that close. The deviation is expressed as a percentage of the
close, so the formula is
</p>
<div class="example">
<pre class="example-preformatted"> close - forecast
%F = ---------------- * 100
close
forecast = linear regression of previous N days, at today
</pre></div>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<p>
Next: <a href="#Klinger-Volume-Oscillator" accesskey="n" rel="next">Klinger Volume Oscillator</a>, Previous: <a href="#Gopalakrishnan-Range-Index" accesskey="p" rel="prev">Gopalakrishnan Range Index</a>, Up: <a href="#Indicators" accesskey="u" rel="u...
</div>
<h3 class="section" id="Intraday-Momentum-Index-1"><span>10.19 Intraday Momentum Index<a class="copiable-link" href="#Intraday-Momentum-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Intraday-momentum-index"></a>
<a class="index-entry-id" id="index-Index_002c-Intraday-momentum"></a>
<a class="index-entry-id" id="index-IMI"></a>
<a class="index-entry-id" id="index-Chande_002c-Tushar-4"></a>
<p>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).
</p>
<div class="example">
<pre class="example-preformatted"> Sum[N] of max(close-open, 0)
IMI = ----------------------------
Sum[N] of abs(close-open)
</pre></div>
<p>This is like an RSI (see <a class="pxref" href="#Relative-Strength-Index">Relative Strength Index</a>) but on open-to-close
movement and with a simple moving average.
lib/App/Chart/doc/chart.html view on Meta::CPAN
<p>
Next: <a href="#Money-Flow-Index" accesskey="n" rel="next">Money Flow Index</a>, Previous: <a href="#MASS-Index" accesskey="p" rel="prev">MASS Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-Index"...
</div>
<h3 class="section" id="Momentum"><span>10.24 Momentum<a class="copiable-link" href="#Momentum"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Momentum"></a>
<a class="index-entry-id" id="index-Rate-of-change"></a>
<a class="index-entry-id" id="index-ROC"></a>
<p>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
</p>
<div class="example">
<pre class="example-preformatted">Momentum = p[1] - p[N+1]
p[1] - p[N+1]
ROC = 100 * -------------
p[N+1]
lib/App/Chart/doc/chart.html view on Meta::CPAN
<div class="nav-panel">
<p>
Next: <a href="#On_002dBalance-Volume" accesskey="n" rel="next">On-Balance Volume</a>, Previous: <a href="#Momentum-and-Rate-of-Change" accesskey="p" rel="prev">Momentum</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a ...
</div>
<h3 class="section" id="Money-Flow-Index-1"><span>10.25 Money Flow Index<a class="copiable-link" href="#Money-Flow-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Money-Flow-Index"></a>
<a class="index-entry-id" id="index-MFI"></a>
<a class="index-entry-id" id="index-Index_002c-money-flow"></a>
<p>The Money Flow Index (MFI) ranges 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 past N days.
</p>
<p>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,
</p>
<div class="example">
<pre class="example-preformatted"> high + low + close
typical price = ------------------
3
lib/App/Chart/doc/chart.html view on Meta::CPAN
<div class="example">
<pre class="example-preformatted"> / close
| ----------- if vol > vol[prev]
PVI = PVI[prev] * | close[prev]
|
\ 1 if vol <= vol[prev]
</pre></div>
<p>The fraction <em class="math">close/close[prev]</em> means that the indices
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
the start is 100 for the first data portion displayed.
</p>
<p>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.
</p>
lib/App/Chart/doc/chart.html view on Meta::CPAN
</div>
<h3 class="section" id="Polarized-Fractal-Efficiency-1"><span>10.28 Polarized Fractal Efficiency<a class="copiable-link" href="#Polarized-Fractal-Efficiency-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Polarized-fractal-efficiency"></a>
<a class="index-entry-id" id="index-PFE"></a>
<a class="index-entry-id" id="index-Fractal_002c-polarized-efficiency-indicator"></a>
<p>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.
</p>
<p>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
</p>
<div class="example">
<pre class="example-preformatted"> 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)
</pre></div>
<p>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.
</p>
<p>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.
</p>
<p>Hannula looked at price changes over 10 day period (horizontal distance of 9),
lib/App/Chart/doc/chart.html view on Meta::CPAN
<div class="nav-panel">
<p>
Next: <a href="#QStick" accesskey="n" rel="next">QStick</a>, Previous: <a href="#Pretty-Good-Oscillator" accesskey="p" rel="prev">Pretty Good Oscillator</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-In...
</div>
<h3 class="section" id="Price-and-Volume-Trend-1"><span>10.30 Price and Volume Trend<a class="copiable-link" href="#Price-and-Volume-Trend-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Price-and-volume-trend"></a>
<a class="index-entry-id" id="index-PVT"></a>
<a class="index-entry-id" id="index-Volume_002c-price-trend"></a>
<p>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.
</p>
<div class="example">
<pre class="example-preformatted"> close[today] - close[yesterday]
PVT = PVTprev + volume * -------------------------------
close[yesterday]
</pre></div>
<p>The starting point (ie. the zero point) for the running total is arbitrary.
In Chart it’s merely the segment of data first displayed.
lib/App/Chart/doc/chart.html view on Meta::CPAN
</div>
<div class="section-level-extent" id="RAVI">
<div class="nav-panel">
<p>
Next: <a href="#Relative-Strength-Index" accesskey="n" rel="next">Relative Strength Index</a>, Previous: <a href="#R_002dSquared-Index" accesskey="p" rel="prev">R-Squared Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> &nbs...
</div>
<h3 class="section" id="RAVI-1"><span>10.33 RAVI<a class="copiable-link" href="#RAVI-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-RAVI"></a>
<p>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 <a class="pxref" href="#Simple-Moving-Average">Simple Moving Average</a>). The defaults are 7 days and 65 days.
</p>
<div class="example">
<pre class="example-preformatted"> abs (SMA[short] - SMA[long])
RAVI = 100 * ----------------------------
SMA[long]
</pre></div>
lib/App/Chart/doc/chart.html view on Meta::CPAN
<a class="index-entry-id" id="index-Stochastics"></a>
<a class="index-entry-id" id="index-Lane_002c-George"></a>
<p>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.
</p>
<a class="index-entry-id" id="index-_0025K-stochastic"></a>
<p>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.
</p>
<div class="example">
<pre class="example-preformatted"> close - Nday low
%K = 100 * --------------------
Nday high - Nday low
</pre></div>
<a class="index-entry-id" id="index-_0025D-stochastic"></a>
<p>An extreme of 0 is reached for a close at the day’s low which is also a new
N-day low. Likewise 100 for a close at the day’s high and a new N-day high.
lib/App/Chart/doc/chart.html view on Meta::CPAN
the sign discarded and are down deviations.
</p>
<div class="example">
<pre class="example-preformatted">up = / close - average if close > average
\ 0 otherwise
down = / average - close if average < close
\ 0 otherwise
</pre></div>
<p>The percentage of the total up amounts out of total up and down amounts is
then the trend intensity index,
</p>
<div class="example">
<pre class="example-preformatted"> total up
TDI = 100 * ---------------------
total up + total down
</pre></div>
<p>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
lib/App/Chart/doc/chart.html view on Meta::CPAN
<div class="section-level-extent" id="TRIX">
<div class="nav-panel">
<p>
Next: <a href="#Twiggs-Money-Flow" accesskey="n" rel="next">Twiggs Money Flow</a>, Previous: <a href="#True-Strength-Index" accesskey="p" rel="prev">True Strength Index</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a h...
</div>
<h3 class="section" id="TRIX-1"><span>10.43 TRIX<a class="copiable-link" href="#TRIX-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-TRIX"></a>
<a class="index-entry-id" id="index-Hutson_002c-Jack"></a>
<p>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 smoothed EMA values.
</p>
<div class="example">
<pre class="example-preformatted"> EMAofEMAofEMA[today] - EMAofEMAofEMA[yesterday]
TRIX = 100 * ---------------------------------------
EMAofEMAofEMA[yesterday]
</pre></div>
<p>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
lib/App/Chart/doc/chart.html view on Meta::CPAN
</div>
<h3 class="section" id="Ulcer-Index-1"><span>10.46 Ulcer Index<a class="copiable-link" href="#Ulcer-Index-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Ulcer-index"></a>
<a class="index-entry-id" id="index-Index_002c-Ulcer"></a>
<p><a class="uref" href="http://www.tangotools.com/ui/ui.htm">http://www.tangotools.com/ui/ui.htm</a>
</p>
<a class="index-entry-id" id="index-Martin_002c-Peter"></a>
<p>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 close a retracement percentage is calculated, relative to the highest
close so far.
</p>
<div class="example">
<pre class="example-preformatted"> price[i] - maxprice so far
R[i] = --------------------------
maxprice so far
</pre></div>
<a class="index-entry-id" id="index-Quadratic-mean"></a>
<a class="index-entry-id" id="index-Mean_002c-quadratic"></a>
lib/App/Chart/doc/chart.html view on Meta::CPAN
the total true range over that period. If bp1 is today, bp2
yesterday, etc then
</p>
<div class="example">
<pre class="example-preformatted"> bp1 + bp2 + ... + bp7
avg7 = ---------------------
tr1 + tr2 + ... + tr7
</pre></div>
<p>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.
</p>
<div class="example">
<pre class="example-preformatted"> 4 * avg7 + 2 * avg14 + avg28
UltOsc = 100 * ----------------------------
4 + 2 + 1
</pre></div>
<p>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.
lib/App/Chart/doc/chart.html view on Meta::CPAN
<div class="section-level-extent" id="Zig-Zag-Indicator">
<div class="nav-panel">
<p>
Previous: <a href="#Williams-Accumulation_002fDistribution" accesskey="p" rel="prev">Williams Accumulation/Distribution</a>, Up: <a href="#Indicators" accesskey="u" rel="up">Indicators</a> [<a href="#Concept-Index" title="Index" rel="index">In...
</div>
<h3 class="section" id="Zig-Zag-Indicator-1"><span>10.52 Zig Zag Indicator<a class="copiable-link" href="#Zig-Zag-Indicator-1"> ¶</a></span></h3>
<a class="index-entry-id" id="index-Zig-zag-indicator"></a>
<a class="index-entry-id" id="index-Indicator_002c-zig-zag"></a>
<p>The zig zag indicator is a simple way to ignore retracements less than a given
X percentage.
</p>
<p>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 that latest high is
penetrated. Then a down line is drawn, it in turn continuing until a reversal
of more than X% above the last lowe occurs. The result is a kind of zig zag,
ignoring small moves, small according to the X%.
</p>
<p>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
maybe/SMA-class.pm view on Meta::CPAN
{ name => __('Moving Median'),
shortname => __('Median'),
manual => __p('manual-node','Moving Median'),
parameter_info => [ { key => 'N',
name => __('Days'),
type => 'integer',
minimum => 1,
maximum => 20 },
{ key => 'fractile',
name => __('Fractile'),
type => 'percentage',
default => 50,
minimum => 0,
maximum => 100 } ];
};
sub new {
my ($class, %self) = @_;
my $n = $self{'N'};
($n > 0) or croak "App::Chart::Average::Median bad N: $n";
misc/t-raw.pl view on Meta::CPAN
my $dbh = App::Chart::DBI->instance;
my $datasheet_def
= { dbh => $dbh,
sql => { select => "date, new, old, note",
from => "split",
order_by => "date"
},
vbox => $vbox,
fields => [ { name => 'date',
x_percent => 35,
# validation => sub { &validate_first_name(@_); }
},
{ name => 'new',
align => 'right',
x_percent => 35
},
{ name => 'old',
align => 'right',
x_percent => 30,
},
{ name => 'note',
align => 'right',
x_percent => 30,
},
],
};
sub validate_date {
my ($str) = @_;
return ($str =~ /^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/);
}
$datasheet_def
misc/t-raw.pl view on Meta::CPAN
{ name => 'record_date',
# renderer => 'date',
validation => \&validate_date,
},
{ name => 'pay_date',
# renderer => 'date',
validation => \&validate_date,
},
{ name => 'amount',
align => 'right',
# x_percent => 35
},
{ name => 'imputation',
align => 'right',
# x_percent => 30,
},
{ name => 'qualifier',
header_markup => 'Qualifier',
},
{ name => 'note',
# x_percent => 30,
},
],
};
$datasheet_def
= { dbh => App::Chart::DBI->instance,
sql => { select => 'date, open, high, low, close, volume, openint',
from => 'daily',
order_by => 'date',
where => 'symbol=?',
unused/YahooOld.pm view on Meta::CPAN
#
# http://download.finance.yahoo.com/d?
# s= # symbol
# f= # format, concat of the following
# s # symbol
# n # company name
# l1 # last price
# d1 # last trade date (in home exchange's timezone)
# t1 # last trade time (in yahoo server timezone)
# c1 # change
# p2 # percent change
# v # volume
# a2 # average daily volume
# b # bid
# b6 # bid size
# a # ask
# a5 # ask size
# k1 # "time - last" (ECN), with <b> and <i> markup
# c6 # change (ECN)
# m2 # day's range (ECN)
# b3 # bid (ECN)