MTA Paper
DEMYSTIFYING
DIVERGENCE
By William Brower, CTA 5-19-2001
One of the last bastions of technical analysis smoke and mirrors is
divergence. Generally stated, bearish divergence is signaled when price
moves to new or equal highs while upward momentum slows.
Bullish divergence is signaled when price moves to new or equal lows
while downward momentum slows.;Indicators
used to measure the momentum component often include Stochastics and RSI but can
include almost any oscillator. The
computation is usually done by comparing the current price move with the price
move at an earlier price peak.
Here is a partial list of problems associated with
divergence.
·
Rules are not objective: What is a price peak?
·
What happens between peaks is often not defined.
·
The oscillator is usually not synchronized with the price peaks.
·
Detecting divergence requires some weakening of price. How much?
·
There are many prior price peaks.
Which ones do we use?
Trading off of divergence
signals is a bit like mating with a tarantula. When done successfully it can be satisfying, but when not successful you
get eaten alive. The only way to
know if divergence works is to build a trading system and test it.
The most important concept in doing this is to synchronize the location
of the price peaks with the measurement of momentum.
This requires a variable look back length for the momentum measurement.
Rules for a reliable,
objective, mechanical bearish divergence detection program:
·
Price must be lower than the previous bar.
·
Scan backwards until price drops below the current bar to find peak C.
·
Keep scanning backwards until price starts to rise.
We have a valley. B
·
Keep scanning backwards until price starts to fall to find prior peak. A
·
When price falls below the valley B stop looking and check for divergence.
·
If price rises above peak C before falling below B
stop searching.
·
If the difference between C and B is more than some
minimum momentum amount and the number of bars between A
and C is more than some minimum number then we look for divergence.
Divergence is signaled when the move from B
to C is weaker than the strongest
move within the same number of bars on the way up to A.
·
If divergence is not found we keep searching back until one of 3
things happen, we have reached the maximum look back allowed, price has risen
above C, or we have found divergence.
Building a Mechanical
Trading System
When divergence is signaled,
we generate a sell signal at price B
(the low of the valley between the price peaks) on a stop. This order is not cancelled until price rises above price
peak C.
If filled, the protective stop is peak C. We stay in the trade
for half the number of bars between peaks A
and C. We do not take the trade if the risk is too high (the
vertical distance between B and C is the risk).
Testing the System
Testing was performed on back
adjusted futures contracts. All
data was ASCII format and the testing was performed using OmegaResearch
TradeStation™. Slippage and
commission for the testing is as follows:
NASDAQ
100 = $400
S&P500
= $150
All
other contracts = $100.
Bullish trades were tested
separately from bearish trades. The
system inputs were identical for all commodities for both bullish and bearish
trades as follows:
Price_H
Close (price used to detect peak A and C)
Price_L
Close (price used to detect peak B)
Lookback
100 (maximum value reached by one counter)
MinBars
8 (bars between peaks A and C)
MinPct
.2 (min percent move from B to C)
Risk
$20000 (vertical distance from B to C in dollars)
The time period
tested for each commodity is as follows:
NASDAQ 100 45 min
bars
1/5/98 through 2/28/01
SP500
45 min bars 1/5/98
through 2/28/01
DX
Daily Bars
11/25/85 through 3/21/01
JY
Daily Bars
3/26/81 through 3/21/01
SF
Daily Bars
3/26/81 through 3/21/01
The
system performance can be seen on the Test Results
page.
|