Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ADVANCED Strategies

MEASURING trend momentum


Most technical analysis
indicators monitor either
price direction or price
momentum.
Heres an indicator that
does both, changing
its behavior with the
dynamics of the market.
BY TUSHAR CHANDE

f all the price-based technical indicators, few are as


popular as simple moving
averages. A simple moving average (SMA) is the average of a
specific price point, usually the close,
over a prescribed time period.
The primary function of moving averages is to smooth prices, thus identifying the underlying trend. Countless systems have been built using moving averages and many billions of dollars traded
based on their signals. As a tool, they are
robust, simple to construct and easy to
understand.
As with all technical indicators, SMAs
have their limitations. Since they smooth
past data, they lag the actual price movement (i.e., any decline in the price of a
stock will not be detected by the SMA
until several time periods later). Many
attempts have been made to make moving
averages more sensitive to recent data.
62

The weighted moving average (WMA),


for example, gives greater weight to recent
data. Similarly, the exponential moving
average (XMA) also gives the greatest
weight to the most recent data, but unlike
the WMA, the XMA takes all available
data into account. In these instances, fixed
weights are assigned to the data in calculating the moving average.

The variable-index dynamic moving


average (VIDYA), originally developed
in 1992, uses market information such
as volatility to make the weighting
scheme used to compute the moving

average more responsive to market


action. Since its inception, it has been
added to many commercial software
packages and inspired many other
traders to build their own dynamic moving averages.
One of the features of VIDYA that
makes it particularly attractive is that it
flattens when the market consolidates.
(To learn more about this indicator see
The New Technical Trader, Chande and
Kroll, John Wiley & Sons, 1994, and
Beyond Technical Analysis, second edition,
John Wiley & Sons, 2001.)
However, a new variable moving average one that is, like VIDYA, responsive

www.activetradermag.com June 2001 ACTIVE TRADER

to market consolidations but is more


directly tied to the trend can be constructed. It is formed by combining the
ideas behind the following three common
indicators: the average directional index
(ADX), the stochastic oscillator and exponential moving averages (XMA). The
resulting indicator is called the Chande
Directional Moving Average (CDMA).

The plan behind the new CDMA is to


apply the stochastic oscillator to the values of the ADX. When the ADX is rising,
there will be a trend, and a stochastic
applied to the ADX will be near the top
of its range. Conversely, when the ADX
is falling, which implies a lack of trend, a
stochastic of the ADX will be near the
bottom of its range. The stochastic reading (translated into a value between 0 to
1, instead of 0 and 100) will then be used
to weigh the XMAfor the current bar.
If the stochastic oscillator applied to
the ADX indicator is 0, the assumption is
that there is no trend and the new value
of the XMAwill be equal to the old value
of the XMA. Hence, the CDMAwill flatten out. When the CDMA confirms the
XMA action, the trend has strong
momentum; when they diverge, caution
may be warranted.
Figure 1 (below) shows the CDMA

(solid line) and the equivalent 20-day


XMA (small crosses) on a continuous
chart of the Nasdaq 100 futures. The
lower half of Figure 1 shows a plot of the
20-day ADX. The market is trending
when the ADX is above the reference
level of 20 and rising. The values chosen
for the length of the ADX and the reference level are arbitrary.

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

FIGURE 2 WORKING IN TANDEM


During May and June 1999, the CDMA stayed flat, indicating the market was in a consolidation
and that the crossover signals between price and the XMA should be ignored. However, when
the market broke down in September, both MAs were moving in tandem, signaling a valid
trading opportunity.
Dow Jones Industrial Average Index (DJIA), daily

11800
11600
11400
11200
11000
10800
10600
10400
10200
10000
9800

ADXW REF 33.40 20.00


40.00
30.00
20.00
May

June

July

Aug.

Sept.

Oct.

Nov.

Dec.

2000

Feb.

Mar.

Source: TradeStation by TradeStation Group Inc.

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

When the Nasdaq rally


resumed in February, the
CDMA followed the
XMA reluctantly, as the
ADX had flattened out,
even though it was above
the 20 level. This is typical of rallies after brief
consolidations
within
prolonged bull trends.
The difference in behavior between the CDMA
and XMA is explained by
the fact that the CDMA
responds to changes in
momentum rather than
prices.
Figure 2 (left) shows a
continuous chart of Dow
Jones futures. Note how
the CDMA (solid line)
flattened out during consolidations, and how the
CDMA and the 20-day
XMA (crosses) came
together during declines,
confirming the bearish
tone of the market.

The CDMA is a valuable


variation on traditional
moving averages but, like
any other indicator, it has
limitations. For example,
price could continue to
rise or fall slowly after an
initial strong move. In
this case, the ADX will be
declining and the CDMA
will flatten out, showing
a lack of trend. However,
the price action in this
instance would be worth
trading, as in the most
recent period in Figure 1.
Even so, you can use
the CDMA to confirm
that market momentum
supports the move indicated by the equivalent
XMA. You can also use it
for any time frame, ranging from intraday to
monthly data, and it
gives you the ability to
combine multiple time
frames, as well as
momentum data, into a
single indicator.

www.activetradermag.com June 2001 ACTIVE TRADER

You might also like