Tushare Chande Momentum PDF
Tushare Chande Momentum PDF
A complete discussion of the ADX, stoIn October 1999, the ADX was at a low
chastic oscillator and XMAis beyond the
level, indicating a lack of trend, and the
scope of this article, but a brief summary
CDMA and the XMA had separated. As
will provide the necessary background
the market broke out of a trading range,
for our new indicator.
the ADX quickly rose above 20 and the
The ADX has a rather complex calcuCDMA and XMA values converged raplation; it can be approximated by taking
idly, confirming the rally. During the conthe simple moving average of a simple
solidation in January, the ADX declined
moving average of closing prices (doubut stayed above 20, showing a weakenble smoothing). While the ADX
ing trend. Hence, CDMAand XMA separesponds unevenly to price action, it is
rated, with the CDMAflattening out.
generally considered an excellent indicacontinued on p. 64
tor of trend strength.
The stochastic oscillaFIGURE 1 CONFIRMING THE TREND
tor is comprised of two
lines: %K and %D, the
Notice how the Chande Directional Moving Average (solid line) has a more stable appearance
latter of which is a movthan a regular exponential moving average. This characteristic can help you filter out
ing average of %K. To
whipsaw trades that are common during market consolidations.
calculate %K, subtract
the lowest price of the
4600.0
Nasdaq 100 Index (NDX), daily
most recent n bars from
4400.0
the most recent close,
4200.0
and divide that total by
the range (high-low) of
4000.0
the most recent n bars.
3800.0
Stochastics range from 0
3600.0
to 100. A reading over 80
3400.0
is considered overbought
and a reading below 20 is
3200.0
considered oversold.
3000.0
An exponential mov2800.0
ing average is constructed by adding a fixed per2600.0
centage, x, of the latest
2400.0
closing price to (1-x) of
ADXW REF 22.35 20.00
40.00
the previous value of the
35.00
moving average. For
30.00
example, an XMA could
25.00
add 20 percent of the lat20.00
est close to 80 percent of
15.00
yesterdays XMA to find
todays XMA. An XMAis
October
November
December
January 2000 February
March
designed to give recent
Source: TradeStation by TradeStation Group Inc.
prices greater weight.
ACTIVE TRADER June 2001 www.activetradermag.com
63
11800
11600
11400
11200
11000
10800
10600
10400
10200
10000
9800
June
July
Aug.
Sept.
Oct.
Nov.
Dec.
2000
Feb.
Mar.
Programming code
{Tushar Chande 2001: VIDYA/CDMA}
Input: Len(10);
Vars: Diff(0), MyConst(0), MyAdx(0), Varma(0), EmaIndex(0);
{ Index of EMA }
If Len > 0 then EmaIndex = (2 / (1 + Len)) else EmaIndex = 0.20;
{ Stochastic oscillator using ADX }
MyAdx = ADX(20);
Diff = Highest(MyAdx, 20) - Lowest(MyAdx, 20);
If Diff > 0 then MyConst = (MyAdx - Lowest(MyAdx, 20))/Diff else MyConst = EmaIndex;
{ Clamp length to that implied by input value of Len }
If MyConst > EmaIndex then MyConst = EmaIndex;
{ Create the variable MA }
If CurrentBar < 50 then Varma = Close else Varma = (1 - MyConst) * Varma[1] + MyConst * Close;
Plot1(Varma, VarMA) ;
Plot2(XAverage(Close, Len), XAvg)
This code can be copied from www.activetradermag.com/code.htm.
64