<< . .

. 13
( : 30)

. . >>

caused the shorter moving average to become equivalent to the prices; therefore, in
the optimization, the model in which prices were compared to the moving average
was tested, as was the model in which one moving average was compared to anotb
er. Only cases where the longer moving average was strictly longer than the shorter
moving average were examined. The parameters were chosen to minimize the prob-
ability that any profitable performance was due to chance. The model was then run
on the out-of-sample data using the best parameter set found in-sample.
Tables 6-4 and 6-5 show, for Tests 25 through 48, the commodities that the
model traded profitably and those that lost, in-sample (Table 6-4) and out-of-sam-
ple (Table 6-S). The plus and dash symbols may be interpreted in the same man-
ner as for Tables 6-1 and 6-2.
Table 6-6 provides the results broken down by the moving average, model,
order, and sample. The last two columns on the right, and the last four rows of
numbers on the bottom, are averages. The numbers at the bottom were averaged
over all combinations of moving average type and model. The numbers at the right
were averaged over order type.
Overall, the best models in-sample were the simple moving average sup-
port/resistance and the front-weighted triangular average support/resistance. The
simple average support/resistance with a stop order was unique in that it showed
small profits in both samples: an average trade of $227 and a 4.2% retum-on-
account in-sample, $482 per trade and a 14.8% return-on-account out-of-sample.
The front-weighted triangular average with the stop was profitable in-sample, but
lost heavily out-of-sample. Both models, especially when combined with a stop,
had relatively few trades: consequently, the results are less statistically stable.

In-Sample Performance Broken Down by Test and Market

Overall, in-sample, the stop order was best for contrarian crossovers and for sup-
port/resistance models, in which the stop led to an average profitable result, and
the other two orders led to losses; the market-at-open was the worst order. Out-of-
sample, the market-at-open order was still, overall, worst for both the contrarian
crossover and the support/resistance models; the limit was best. There were much
greater losses out-of-sample than in-sample for both models.
The countertrend models pertormed less well than the trend-following ones;
however, there were outstanding combinations of counter-trend model, average we,
and entry order that performed far better than most other combinations tested.
On the basis of the moving average and breakout results, it appears that,
with trend-following models, a limit order almost always helps performance; for
Out-of-Sample Performance Broken Down by Test and Market

countertrend models, a stop sometimes provides an extra edge. This tendency
might result from trend-following models already having a trend detection ele-
ment: Adding another detection or verification element (such as an entry on a
stop) is redundant, offering no significant benefit; however, the addition of a limit
order provides a countertrend element and a cheaper entry, thus enhancing per-
formance. With countertrend models, the addition of a trend verification element
provides something new to the system and, therefore, improves the results.
Sometimes it is so beneficial that it compensates for the less favorable entry
prices that normally occur when using stops.
On a market-by-market basis, model-order combinations that were strongly
profitable in both samples could be found for T-Bonds, JO-Year Notes, Japanese
Summary of Countertrend Moving Average Entry M o d e l s B r o k e n
Down by Order, Moving Average Type, Model, and Sample

Yen, Deutschemark, Swiss Franc, Light Crude, Unleaded Gasoline, Coffee,
Orange Juice, and Pork Bellies.
Figure 6-2 depicts equity curves broken down by model and moving average
combination; equity was averaged over order type. The best two models were the
front-weighted triangular average support/resistance and the simple average sup-
port/resistance. The best support/resistance models performed remarkably better
than any of the contrarian crossover models. There were three eras of distinct
behavior: the beginning of the sample until October 1987, October 1987 until June
1991, and June 1991 through December 1998, the end of the sample. The worst
performance was in the last period.

Equity Curves by Model and Moving Average Combination

. . . . ..*M*-8a

On the basis of the equity curves in Figure 6-2, as well as others not
shown, it is evident that the countertrend models were better in the past, while
the trend-following models performed better in recent times. In-sample, the
stop order was best for every model-average combination, and, out-of-sample,
for three of the six (two combinations had no trades so were not considered);
entry at the open was worst in all but two cases. The stop was generally supe-
rior to the limit order, in-sample; out-of-sample, the limit was only marginally
better than the stop.

In general, the trend-following models in Tests 1 through 24 performed better than
the countertrend models in Tests 25 through 48, with a number of exceptions dis-
cussed above.
The best models apparently are those that combine both countertrend and
trend-following elements. For example, attempting to buy on a retracement with
a limit, after a moving average crossover or breakout, provides better results than
other combinations. In the countertrend moving average models, those that have
a trend-following element (e.g.. a stop) perform better. Pure countertrend models
and pure trend-following models do not fare as well. Moreover, adding a trend-
following filter to an already trend-following system does not seem beneficial,
but may instead increase entry cost. Traders should try combining one of these
countertrend models with something like the ADX trend filter. Although the ADX
filter may not have helped breakouts (because, liethe stop, it represents anoth-
er trend-following element added to an already trend-following model), in a
countertrend model such an element may provide an edge. As true with break
outs, the limit order performed best, except when the stop was beneficial due to
its trend filtering characteristics,
The results suggest certain generalizations. Sometimes a stop can provide
enough benefit to overcome the extra transaction costs associated with it, although
a limit order generally performs best because of its ability to reduce costs. While
such a generalization might help guide a trader™s choices, one has to watch for
potential interactions within the moving average type-model-order combinations
that may cause these generalizations to fail. The variables interact: Although each
variable may have its own characteristic effect, when put in combination with
other variables, these effects may not maintain their integrity, but may change due
to the coupling; this is demonstrated in the tests above. Sometimes variables do
maintain their integrity, but not always.

. When designing an entry model, try to effectively combine a countertrend
element with a trend-following one. This may be done in any number of
ways, e.g., buy on a short-term countertrend move when a longer-term
trend is in progress; look for a breakout when a countertrend move is in
progress; or apply a trend-following filter to a countertrend model.
n If possible, use orders that reduce transaction costs, e.g., a limit order for

entry. But do not be rigid: Certain systems might perform better using
another kind of order, e.g., if a trend-following element is needed, a stop
might be advisable.
n Expect surprises. For the slope-based models, we thought the adaptive,

moving average, with its faster response, would provide the best perfor-
mance; in fact, it provided one of the worst.
. Even though traditional indicators, used in standard ways, usually fail (as
do such time-honored systems as volatility breakouts), classical concepts
like suppoa/resistance may not fail; they may actually be quite useful. In
breakouts, models based on the notion of support/resistance held up bet-
ter than did, e.g., volatility breakouts. Likewise, moving average models
using the concept of support/resistance did better than others. The sup-
port/resistance implementation was rudimentary, yet, in the best combina-
tion, it was one of the best performers; perhaps a more sophisticated
version could provide a larger number of more profitable trades.
Although support/resistance seems to be an important concept, further
research on it will not be easy. There are many variations to consider
when defining levels of support and resistance. Determining those levels
can be quite challenging, especially when doing so mechanically.

Oscillator-Based Entries

0. have been popular among technical traders for many years. Articles
that describe oscillators appear quite frequently in such magazines as Technical
Analysis of Stocks and Commodities and Futures. The subject is also covered in
many books on uading.
Most widely used, in both their classic forms and variations, are Appel™s
(1990) Moving Average Convergence Divergence (MACD) oscillator and MACD-
Histogram (MACD-H). Also highly popular are Lane™s Stochastic, and Williams™s
Relative Strength Index (RSI). Many variations on these oscillators have also
appeared in the literature. Other oscillators include Lambert™s Commodities
Channel Index (CCI), the Random Walk Index (which might be considered an
oscillator), and Goedde™s (1997) Regression Channel Oscillator. In this chapter,
the primary focus is on the three most popular oscillators: the MACD, Stochastic&
and the RSI.

An oscillator is an indicator that is usually computed from prices and that tends to
cycle or “oscillate” (hence the name) within a fixed or fairly limited range.
Oscillators are characterized by the normalization of range and the elimination of
long-term trends or price levels. Oscillators extract information about such tran-
sient phenomena as momentum and overextension. Momentum is when prices
move strongly in a given direction. Overextension occurs when prices become
excessively high or low (“overbought” or “oversold”) and are ready to snap back
to more reasonable values.
There are two main forms of oscillators. Linear band-pass filters are one form of
oscillator. They may be analyzed for frequency (periodicity) and phase response.
The MACD and MACD-H are of this class. Another form of oscillator places
some aspect of price behavior into a normalized scale (the RX, Stochastics, and
CC1 belong to this class); unlike the first category, these oscillators are not linear
filters with clearly defined phase and frequency behavior. Both types of oscillators
highlight momentum and cyclical movement, while downplaying trends and elim-
inating long-term offsets: i.e., they both produce plots that tend to oscillate.
The Moving Average Convergence Divergence Oscillator, or MACD (and
MACD-Histogram), operates as a crude band-pass filter, removing both slow
trends and offsets, as well as high-frequency jitter or noise. It does this while pass-
ing through cyclic activity or waves that fall near the center of the pass-band. The
MACD smooths data, as does a moving average; but it also removes some of the
trend, highlighting cycles and sometimes moving in coincidence with the market,
i.e., without lag. Ehlers (1989) is a good source of information on this oscillator.
The MACD is computed by subtracting a longer moving average from a
shorter moving average. It may be implemented using any kind of averages or low-
pass filters (the classic MACD uses exponential moving averages). A number of
variations on the MACD use more advanced moving averages, such as the VIDYA
(discussed in the chapter on moving averages). Triangular moving averages have
also been used to implement the MACD oscillaror. Along with the raw MACD, the
so-called MACD Histogram (MACD-H) is also used by many traders. This is
computed by subtracting from the MACD a moving average of the MACD. In
many cases, the moving average of the MACD is referred to as a signul line.
The Stochastic oscillator is frequently referred to as an overbought/oversold
indicator. According to Lupo (1994), “The stochastic measures the location of the
most recent market action in relation to the highest and lowest prices within the
last ” n bars. In this sense, the Stochastic is a momentum indicator: It answers
the question of whether the market is moving to new highs or new lows or is just
meandering in the middle.
The Stochastic is actually several related indicators: Fast %K, Slow %K
(also known as Fast %D), and Slow %D. Fast %K measures, as a percentage, the
location of the most recent closing price relative to the highest high and lowest low
of the last II bars, where n is the length or period set for the indicator. Slow %K,
which is identical to Fast %D, applies a 3-bar (or 3-day) moving average to both
the numerator and denominator when computing the %K value. Slow %%J is sim-
ply a 3-bar simple moving average of Slow %K; it is occasionally treated as a sig-
nal line in the same way that the moving average of the MACD is used as a signal
line for the MACD.
There have been many variations on the Stochastic reported over the years;
e.g., Blau (1993) discussed a double-smoothing variation. The equations for the
classical Lane™s Stochastic are described in an article by Meibahr (1992). A ver-
sion of those equations appears below:
A(i) = Highest of H(i), H(i - l), H(i - n + 1)
B(i) = Lowest of .5(i), L(i - l), L(i - n + 1)
D(i) = [A(i) + A(i - 1) + A(i - 2)] / 3
E(i) = [B(i) + B(i - 1) + B(i -2)] / 3
F(i) = [C(i) + C(i - 1) + C(i - 2)] ! 3
Fast %K for ith bar = 100 * [C(i) - B(i)] / [A(i) - B(i)]
Slow %K = Fast %D = 100 * [F(i) - E(i)] I [D(i) - E(i)]
Slow %D = 3.bar simple moving average of Slow %K
In these equations, i represents the bar index, H(i) the high of the ith bar, L(i) the
low of the ith bar, and C(i) the close of the ith bar. All other letters refer to derived
data series needed to compute the various Stochastic oscillators. As can be seen
from the equations, the Stochastic oscillators highlight the relative position of the
close in a range set by recent market highs and lows: High numbers (a maximum
of 100) result when the close is near the top of the range of recent price activity
and low numbers (a minimum of 0) when the close is near the bottom of the range.
The Relative Strength Index, or RX is another well-known oscillator that
assesses relative movement up or down, and scales its output to a fixed range, 0 to
100. The classic RSI makes use of what is essentially an exponential moving aver-
age, separately computed for both up movement and down movement, with the
result being up movement as a percentage of total movement. One variation is to
use simple moving averages when computing the up and down movement com-
ponents. The equations for the classic RSI appear below:
C/(i) = Highest of 0, C(i) - C(i - 1)
D(i) = Highest of 0, C(i - 1) - C(i)
AU(i) = [(n - 1) * AU(i - 1) + U(i)] / n
AD(i) = [(n - 1) * AD(i - I) + D(i)] / n
RSl(i) = 100 *AU(i) / [AU(i) + AD(i)]
The indicator™s period is represented by n, upward movement by U, downward
movement by D, average upward movement by AU, and average downward move-
ment by AD. The bars are indexed by i. Traditionally, a 1Cbar RSI (n = 14) would
be calculated. A good discussion of the RSI can be found in Star (1993).
Finally, there is the Commodities Channel Index, or Ccl, which is discussed in
an article by Davies (1993). This oscillator is like a more statistically aware
Stochastic: Instead of placing the closing price within bands defined by recent highs
and lows, the CC1 evaluates the closing price in relation to bands delined by the mean
and mean deviation of recent price activity. Although not discussed further in this
chapter, the equations for this oscillator are presented below for interested readers:

X(i) = H(i) + L(i) + C(i)
A(i) = Simple n-bar moving average of X(i)
D(i) = Average of 1X(i - k) - A(i) 1 fork = 0 to n - 1
XI(v) = [X(i) - A(i)] / [0.015 * D(i)]
In the equations for the Commodities Channel Index, X represents the so-called
median price, A the moving average of X, D the mean absolute deviations, II the
period for the indicator, and i the bar index.
Figure 7-l shows a bar chart for the S&P 500. Appearing on the chart are the
three most popular oscillators, along with items normally associated with them,
e.g., signal lines or slower versions of the oscillator. Also drawn on the subgraph
containing the Stochastic are the fixed thresholds of 80 and 20 often used as ref-
erence points. For the RSI, similar thresholds of 70 and 30, traditional numbers for
that oscillator, are shown. This figure illustrates how these three oscillators appear,
how they respond to prices, and what divergence (a concept discussed below)
looks like.

There are many ways to generate entry signals using oscillators. In this chapter,
three are discussed.
One popular means of generating entry signals is to treat the oscillator as an
overbought/oversold indicator. A buy is signaled when the oscillator moves below
some threshold, into oversold territory, and then crosses back above that threshold.
A sell is signaled when the oscillator moves above another threshold, into over-
bought territory, and then crosses below that threshold. There are traditional
thresholds that can used for the various oscillators.
A second way oscillators are sometimes used to generate signals is with a
so-called signal line, which is usually a moving average of the oscillator.
Signals to take long or short positions are issued when the oscillator crosses
above or below (respectively) the signal line. The trader can use these signals
on their own in a reversal system or make use of additional, independent exit
Another common approach is to look for price/oscillator divergences, as
described by McWhorter (1994). Divergence is when prices form a lower low
while the oscillator forms a higher low (suggesting a buy), or when prices form a
higher high while the oscillator forms a lower high (suggesting a loss of momen-
tum and a possible sell). Divergence is sometimes easy to see subjectively, but
almost always difficult to detect accurately using simple roles in a program.
Generating signals mechanically for a divergence model requires algorithmic pat-
tern recognition, making the correct implementation of such models rather com-
plex and, therefore, difficult to test. Generating such signals can be done, however;

Examples of Oscillators and Price-Oscillator Divergence

a good example is the “Divergengine” software distributed by Ruggiero
Associates. An example of divergence appears in Figure 7- 1.
There are a number of issues to consider when using oscillators to generate
entries, e.g., smoothing of data and timeliness of entry. The MACD, for example,
can sometimes provide the smoothing of a moving average with the timeliness of
raw prices. The combination of timeliness and good smoothing may yield entries
that are more profitable than those obtained when using moving average entry mod-
els. The peaks and valleys in a moving average come significantly after the corre-
sponding peaks and valleys in prices. Consequently, entries generated by looking for
these peaks and valleys, or ˜Yarning points,” are excruciatingly late. Conversely,
when cyclic activity in the market has a periodicity that matches the particular
MACD used, the peaks and valleys in the output from the MACD come at roughly
the same time as the peaks and valleys in the prices; the smoothing of a moving aver-
age is achieved without the lag of a moving average, Because the MACD smooths
the data, numerous noise-induced trades will be eliminated, as happens with moving
averages. Because the MACD can be timely, trades generated may be profitable.
In addition to the MACD, many other oscillators tend to move concurrently
with prices or even lead them. For reasons to be discussed later, leading or coincident
indicators do not necessarily generate more profitable entries than such lagging indi-
cators as moving averages. Having coincident indicators does not necessarily mean
highly profitable signals. The problem is that even though some signals will occur
with precise timing, many spurious signals can result, especially in the context of
developing trends. When strong trends are present, the anticipated or coincident
reversals may simply never take place, leading to entries in the wrong direction.
Timeliness may be gained, but reliability may be lost. The question of which trade-
off provides a more profitable model-getting in reliably but late, or on time but unre-
liably-is a matter for empirical study. Such issues are present with any entry method
or pattern detection or forecasting model: The greater the delay, the more accurate
(but less useful) the detection or indication; the lesser the delay, or the further ahead
a™forecast must be made, the less accurate (but more useful) the detection or indica-
tion, The logic is not unlike that of the Heisenbetg Uncertainty Principle.
As an example of how oscillators may be used to generate entries, consider the
Stochastic: A simple entry model might buy when this indicator drops below the tra-
ditional oversold threshold of 20 and then rises above that threshold. It might sell
when the indicator goes beyond the traditional overbought threshold of 80 and then
drops back under. The trader must not wait for another signal to close out the current
position, as one might do when using a moving average crossover; such a signal
might not occur for a long time, so an independent exit is essential. Traders also look
for the so-called Stochastic hook, a pattern in which the Stochastic reaches a tirst low,
moves up a little, and then reaches a second low at a higher level than the first. A buy
signal is generated as soon as the second low becomes detined. A sell is generated
with the exact same pattern flipped over; i.e., a lower high follows a higher high.
As in the case of breakouts and moving averages, oscillator-generated entries
can be effected using any of several orders, such as a market at open, limit, or stop.
The advantages and disadvantages of these orders have been discussed thorough-
ly in the previous two chapters.

Oscillator-based entries have the positive characteristic of leading or being coin-
cident with price activity; therefore, they lend themselves to countertrend entries
and have the potential to provide a high percentage of winning trades. Oscillators
tend to do best in cycling or nontrending (trading range) markets. When they work,
oscillators have the appeal of getting the trader in the market close to the bottom
or top, before a move has really begun. For trades that work out this way, slippage
is low or even negative, good fills are easily obtained, and the trade turns profitable
with very little adverse excursion. In such cases it becomes easy to capture a good
chunk of the move, even with a suboptimal exit strategy. It is said that the markets
trend only about 30% of the time. Our experience suggests that many markets
trend even less frequently. With appropriate filtering to prevent taking oscillator-
based signals during strong trends, a great entry model could probably be devel-
oped. The kind of filtering is exactly the opposite of what was sought when test-
ing breakout systems, where it was necessary to detect the presence, rather than
the absence, of trends.
The primary weakness of simple oscillator-based entries is that they perform
poorly in sustained trends, often giving many false reversal signals. Some oscilla-
tors can easily become stuck at one of their extremes; it is not uncommon to see
the Stochastic, for instance, pegged near 100 for a long period of time in the course
of a significant market movement. Finally, most oscillator entry models do not
capture trends, unlike moving averages or breakouts, which are virtually guaran-
teed to capture any meaningful trend that comes along. Many traders say that “the
trend is your friend,” that most money is made going after the “big wave,” and that
the profits earned on such trends can make up for the frequent smaller losses of
trend-following systems. Because oscillator entries go after smaller, countertrend
moves, it is essential to have a good exit strategy to minimize the damage that will
occur when a trend goes against the trades.

All the tests that follow were performed using oscillator entries to trade a diversi-
fied portfolio of commodities, Can oscillator entry models result in profitable
trades? How have they fared over time-have they become more or less profitable
in recent years? These questions will be addressed below.
The exits are the standard ones, used throughout this book in the study of
entry models. Entry rules are discussed along with the model code and under the
individual tests. Trades were closed out either when an entry in the opposing direc-
tion took place or when the standard exit closed the trade, whichever came first.
The test platform is also standard.

<< . .

. 13
( : 30)

. . >>