<< . .

. 8
( : 30)



. . >>

quality! A system that only trades the major crashes on the S&P 500 will yield a
very high total net profit with a very high percentage of winning trades. But who
knows if such a system would hold up? Intuitively, if the system only took two or
three trades in 10 years, the probability seems very low that it would continue to
perform well in the future or even take any more trades. Part of the problem is that
net profit does not consider the number of trades taken or their variability.
An alternative fitness function that avoids some of the problems associated
with net profit is the t-statistic or its associated probability. When using the t-sta-
tistic as a fitness function, instead of merely trying to evolve the most profitable
systems, the intention is to genetically evolve systems that have the greatest like-
lihood of being profitable in the future or, equivalently, that have the least likeli-
hood of being profitable merely due to chance or curve-fitting. This approach
works fairly well. The t-statistic factors in profitability, sample size, and number
of trades taken. All things being equal, the greater the number of trades a system
takes, the greater the t-statistic and the more likely it will hold up in the future.
Likewise, systems that produce more consistently profitable trades with less vari-
ation are more desirable than systems that produce wildly varying trades and will
yield higher t-statistic values. The t-statistic incorporates many of the features that
define the quality of a trading model into one number that can be maximized by a
genetic algorithm.

Multiple Regression
Another statistical technique frequently used is multiple regression. Consider
intermarket analysis: The purpose of intermarket analysis is to find measures of
behaviors in other markets that are predictive of the future behavior of the market
being studied. Running various regressions is an appropriate technique for ana-
lyzing such potential relationships; moreover, there are excellent statistics to use
for testing and setting confidence intervals on the correlations and regression
(beta) weights generated by the analyses. Due to lack of space and the limited
scope of this chapter, no examples are presented, but the reader is referred to
Myers (1986), a good basic text on multiple regression.
A problem with most textbooks on multiple regression analysis (including
the one just mentioned) is that they do not deal with the issue of serial correlation
in time series data, and its effect on the statistical inferences that can be made from
regression analyses using such data. The reader will need to take the effects of
serial correlation into account: Serial correlation in a data sample has the effect of
reducing the effective sample size, and statistics can be adjusted (at least in a
rough-and-ready manner) based on this effect. Another trick that can be used in
some cases is to perform some transformations on the original data series to make
the time series more “stationary” and to remove the unwanted serial correlations.

Monte Carlo Simulations
One powerful, unique approach to making statistical inferences is known as the
Monte Carlo Simulation, which involves repeated tests on synthetic data that are
constructed to have the properties of samples taken from a random population.
Except for randomness, the synthetic data are constructed to have the basic char-
acteristics of the population from which the real sample was drawn and about
which inferences must be made. This is a very powerful method. The beauty of
Monte Carlo Simulations is that they can be performed in a way that avoids the
dangers of assumptions (such as that of the normal distribution) being violated,
which would lead to untrustworthy results.

Out-of-Sample Testing
Another way to evaluate a system is to perform out-of-sample testing. Several time
periods are reserved to test a model that has been developed or optimized on some
other time period. Out-of-sample testing helps determine how the model behaves
68




on data it had not seen during optimization or development. This approach is
strongly recommended. In fact, in the examples discussed above, both in-sample
and out-of-sample tests were analyzed. No corrections to the statistics for the
process of optimization are necessary in out-of-sample testing. Out-of-sample and
multiple-sample tests may also provide some information on whether the market
has changed its behavior over various periods of time.

Walk-Forward Testing
In walk-forward testing, a system is optimized on several years of data and then
traded the next year. The system is then reoptimized on several more years of data,
moving the window forward to include the year just traded. The system is then
traded for another year. This process is repeated again and again, “walking for-
ward” through the data series. Although very computationally intensive, this is an
excellent way to study and test a trading system. In a sense, even though opti-
mization is occurring, all trades are taken on what is essentially out-of-sample test
data. All the statistics discussed above, such as the t-tests, can be used on walk-
forward test results in a simple manner that does not require any corrections for
optimization. In addition, the tests will very closely simulate the process that
occurs during real trading--first optimization occurs, next the system is traded on
data not used during the optimization, and then every so often the system is reop-
timized to update it. Sophisticated developers can build the optimization process
into the system, producing what might be called an “adaptive” trading model.
Meyers (1997) wrote an article illustrating the process of walk-forward testing.

CONCLUSION
In the course of developing trading systems, statistics help the trader quickly reject
models exhibiting behavior that could have been due to chance or to excessive
curve-fitting on an inadequately sized sample. Probabilities can be estimated, and
if it is found that there is only a very small probability that a model™s performance
could be due to chance alone, then the trader can feel more confident when actu-
ally trading the model.
There are many ways for the trader to use and calculate statistics. The cen-
tral theme is the attempt to make inferences about a population on the basis of
samples drawn from that population.
Keep in mind that when using statistics on the kinds of data faced by traders,
certain assumptions will be violated. For practical purposes, some of the violations
may not be too critical; thanks to the Central Limit Theorem, data that are not nor-
mally distributed can usually be analyzed adequately for most needs. Other viola-
tions that are more serious (e.g., ones involving serial dependence) do need to be
taken into account, but rough-and-ready rules may be used to reckon corrections
to the probabilities. The bottom line: It is better to operate with some information,
even knowing that some assumptions may be violated, than to operate blindly.
We have glossed over many of the details, definitions, and reasons behind the
statistics discussed above. Again, the intention was merely to acquaint the reader
with some of the more frequently used applications. We suggest that any commit-
ted trader obtain and study some good basic texts on statistical techniques.
PART II


The Study of Entries
Introduction




I n this section, various entry methods arc systematically evaluated. The focus is
on which techniques provide good entries and which do not. A good entry is
important because it can reduce exposure to risk and increase the likelihood that a
trade will be profitable. Although it is sometimes possible to make a profit with a
bad entry (given a sufficiently good exit), a good entry gets the trade started on the
right foot.

WHAT CONSTITUTES A GOOD ENTRY?
A good entry is one that initiates a trade at a point of low potential risk and high
potential reward. A point of low risk is usually a point from which there is little
adverse excursion before the market begins to move in the trade™s favor. Entries
that yield small adverse excursions on successful trades are desirable because they
permit fairly tight stops to be set, thereby minimizing risk. A good entry should
also have a high probability of being followed quickly by favorable movement in
the market. Trades that languish before finally taking off tie up money that might
be better used elsewhere; not only do such trades increase market exposure, but
they waste margin and lead to “margin-ineffCent” trading or portfolios. Perfect
entries would involve buying the exact lows of bottoming points and selling the
exact highs of topping points. Such entries hardly ever occur in the real world and
are not necessary for successful trading. For trading success it is merely necessary
that entries, when coupled with reasonable exits, produce trading systems that
have good overall performance characteristics.
ORDERS USED IN ENTRIES
Entries may be executed using any of several kinds of orders, including stop
orders, limit orders, and market orders.

Stop Orders
A stop order enters a market that is already moving in the direction of the trade.
A buy or sell is triggered when the market rises above a buy stop or falls below a
sell stop; this characteristic often results in stop orders being used with trend-fol-
lowing entry models. A nice feature of a stop order is that the market must be mov-
ing in a favorable direction at the time of entry. Because of this, the order itself can
act as a contlrming “filter” of the signals generated by the entry model. If a par-
ticular entry happens to be a good one, momenhnn will cause the trade to quickly
turn profitable with hardly any adverse excursion,
On the negative side, an entry executed on a stop order may experience con-
siderable slippage, especially in fast moves, and the market will be bought high or
sold low. Consider the case in which prices begin to move rapidly in favor of a
trade: Buying or selling into such movement is like jumping onto an accelerating
train and is likely to result in large amounts of slippage; the faster the move, the
greater the slippage. Sli˜ppage is the difference between the price at which the stop
is set and the price at which it is actually tilled. Because slippage eats into the
profit generated by the trade, it is undesirable. The most unpleasant situation is
when the entry order gets tilled far past the stop, just as the market begins to
reverse! Because buying or selling takes place on a stop, the market entry occurs
significantly into any move and at a relatively poor price.

Limit Orders
In contrast to a stop order, a limit order results in entry when the market moves
against the direction of the trade. A limit order is an order to buy or to sell at a
specified price or better. For a buy limit to be filled, the market must move below
the limit price; for a sell order, the market must move above the limit price. At least
in the short term, buying or selling takes place against the trend. The count&rend
nature of a limit order and the fact that the market may never move to where the
order can be tilled are the primary disadvantages. However, when working with
predictive, countertrend entry models, the countertrend nature of the limit order
may not be a disadvantage at all. The advantage of a limit order is that there is no
slippage and that entry takes place at a good, known price.

Market Orders
A market order is a simple order to buy or sell at the prevailing market price. One
positive feature of a market order is that it will be executed quickly after being
PART II The Study Of Entries 73




placed; indeed, many exchanges require market orders to be tilled within a few
minutes at most. Stop or limit orders, on the other hand, may sit for some time
before market activity triggers a till. Another benefit is guaranteed execution:
After placing a market order, entry into the trade will definitely take place. The
drawback to the market order is that slippage may occur. However, in contrast to
the stop order, the slippage can go either way-sometimes in the trade™s favor,
sometimes against it--depending on market movement and execution delay.


Selecting Appropriate Orders
Determining which kind of order to use for an entry must include not only con-
sideration of the advantages and disadvantages of the various kinds of orders, but
also the nature of the model that generates the entry signals and its theory regard-
ing market behavior.
If the entry model predicts turning points slightly into the future, a limit
order may be the most appropriate, especially if the entry model provides some
indication of the price at which the turning point will occur. If the entry model
contains specification of price, as do systems based on critical retracement levels,
entry on a limit (with a tight money management exit stop) is definitely the way
to go: A bounce from the retracement level can be expected, and the limit order
will enter at or near the retracement level, resulting in a trade that either quickly
turns profitable (if the market has responded to the critical level as expected) or is
stopped out with a very small loss.
If the entry model requires some kind of confirmation before entry that the
market is moving in the appropriate direction, a stop order might be the best
choice. For example, a breakout system can be naturally married to a stop-based
entry. If the market moves in a favorable direction and passes the breakout thresh-
old price (the same price at which the entry stop is set), entry will occur automat-
ically, and it will be possible to capture any ensuing move. If the breakout price is
not penetrated, the stop will not be triggered and no entry will take place. In this
example, the entry order actually becomes part of the entry model or system.
Market orders are most useful when the entry model only provides timing
information and when the cost (in terms of slippage and delay) of confirming the
entry with a stop order is too great relative to the expected per-trade profit. A mar-
ket order is also appropriate when the timing provided by the system is critical.
For some models, it would make sense to place a stop or a limit order and then, if
the order is not filled within a specified period of time, to cancel the order and
replace it with a market order.
When developing an entry model, it is often worthwhile to examine various
entry orders to determine which are most manageable and which perform best.
The original entry model will probably need modification to make such tests pos-
sible, but the outcome may prove worth the trouble. Examples of various entry
systems tested using these three types of orders (entry at open, on limit, and on
stop) appear throughout the study of entries.

ENTRY TECHNIQUES COVERED IN THIS BOOK
This part of the book explores entry techniques that range from trend-following to
countertrend, from endogenous to exogenous, from traditional to exotic, and from
simple to complex. Since there are an infinite number of entry models, spatial lim-
itations forced us to narrow our focus and discuss only a subset of the possibili-
ties. We attempted to cover popular methods that are frequently discussed, some
of which have been around for decades, but for which there is little objective, sup-
portive evidence. We will systematically put these models to the test to see how
well they work. We have also tried to expand upon some of our earlier, published
studies of entry models in which readers (primarily of ZMtnicul Analysis of Stocks
and Commodities) have expressed great interest.

Breakouts and Moving Averages
Traditional trend-following entry models that employ breakouts and moving aver-
ages are examined in Chapters 5 and 6, respectively. Breakout entn™es are simple and
intuitively appealing: The market is bought when prices break above an upper band
or threshold. It is sold short when prices break below a lower band or threshold.
Operating this way, breakout entries are certain to get the trader on-board any large
market movement or trend. The trend-following entries that underlie many popular
trading systems are breakout entries. Breakout models differ from one another main-
ly in how the threshold bands are computed and the actual entry is achieved.
Like breakouts, moving averages are alluring in their simplicity and are
extremely popular among technical traders. Entries may be generated using mov-
ing averages in any of several ways: The market may be entered when prices cross
over a moving average, when a faster moving average crosses a slower one, when
the slope of a moving average changes direction, or when prices pull back to a mov-
ing-average line as they might to lines of support or resistance. Additional variety
is introduced by the fact that there are simple moving averages, exponential mov-
ing averages, and triangular moving averages, to mention only a few. Since the
entry models of many trading systems employ some variation of breakouts or mov-
ing averages, it seems important to explore these techniques in great detail.

Oscillators
Oscillators are indicators that tend to fluctuate quasi-cyclically within a limited
range. They are very popular among technical traders and appear in most charting
packages. Entry models based on oscillators are “endogenous” in nature (they do
not require anything but market data) and are fairly simple to implement, charac-
teristics they share with breakout and moving-average models. However, breakout
and moving-average models tend to enter the market late, often too late, because
they are designed to respond to, rather than anticipate, market behavior. In con-
trast, oscillators anticipate prices by identifying turning points so that entry can
occur before, rather than after, the market moves. Since they attempt to anticipate
prices, oscillators characteristically generate countertrend entries.
Entries are commonly signaled by divergence between an oscillator and
price. Divergence is seen when prices form a lower low but the oscillator forms a
higher low, signaling a buy; or when prices form a higher high but the oscillator
forms a lower high, signaling the time to sell short.
A signal line is another way to generate entries. It is calculated by taking a
moving average of the oscillator, The trader buys when the oscillator crosses above
the signal line and sells short when it crosses below. Although typically used in
“trading range” markets for countertrend entries, an oscillator is sometimes
employed in a trend-following manner: Long or short positions might be entered
when the Stochastic oscillator climbs above 80 or drops below 20, respectively.
Entry models that employ such classic oscillators as Lane™s Stochastic, Williams™s
RSI, and Appel™s MACD are studied in Chapter 7.


Seasonality
Chapter 8 deals with seasonality, which is construed in different ways by dif-
ferent traders. For our purposes, seasonalify is defined as cyclic or recurrent
phenomena that are consistently linked to the calendar, specifically, market
behavior affected by the time of the year or tied to particular dates. Because
they are predictive (providing trading signals weeks, months, or years ahead),
these models are countertrend in nature. Of the many ways to time entries that
use seasonal rhythms, two basic approaches will be examined: momentum and
crossover. The addition of several rules for handling confirmations and inver-
sions will also be tested to determine whether they would produce results bet-
ter than the basic models.


Lunar and Solar Phenomena
Do lunar and solar events influence the markets? Is it possible for an entry model to
capitalize on the price movements induced by such influences? The moon™s role in
the instigation of tides is undisputed. Phases of the moon correlate with rainfall and
with certain biological rhythms, and they influence when farmers plant crops. Solar
phenomena, such as solar flares and sunspots, are also known to impact events on
earth. During periods of high solar activity, magnetic storms occur that can disrupt
power distribution systems, causing serious blackouts. To assume that solar and
lunar phenomena influence the markets is not at all unreasonable; but how might
these influences be used to generate predictive, countertrend entries?
Consider the lunar rhythm: It is not hard to define a model that enters the mar
ket a specified number of days before or after either the full or new moon. The same
applies to solar activity: An entry can be signaled when the sunspot count rises above
some threshold or falls below another threshold. Alternatively, moving averages of
solar activity can be computed and crossovers of these moving averages used to time
market entries. Lunar cycles, sunspots, and other planetary rhythms may have a real,
albeit small, impact on the markets, an impact that might be profitable with a prop-
erly constructed entry model. Whether lunar and solar phenomena actually affect the
markets sufficiently to be taken advantage of by an astute trader is a question for an
empirical investigation, such as that reported in Chapter 9.

Cycles and Rhythms
Chapter 10 explores cycles and rhythms as a means of timing entries into the mar-
ket. The idea behind the use of cycles to time the market is fundamentally simple:
Extrapolate observed cycles into the future, and endeavor to buy the cycle lows
and sell short the cycle highs. If the cycles are sufficiently persistent and accu-
rately extrapolated, excellent countertrend entries should be the result. If not, the
entries are likely to be poor.
For a very long time, traders have engaged in visual cycle analysis using
charts, drawing tools, and, more recently, charting programs. Although cycles can
be analyzed visually, it is not very difficult to implement cycle recognition and
analysis algorithms in software. Many kinds of algorithms are useful in cycle
analysis-everything from counting the bars between tops or bottoms, to fast
Fourier transforms (FITS) and maximum entropy spectral analyses (MESAS).
Getting such algorithms to work well, however, can be quite a challenge; but hav-
ing reliable software for cycle analysis makes it possible to build objective, cycle-
based entry models and to test them on historical data using a trading simulator.
Whether detected visually or by some mathematical algorithm, market
cycles come in many forms. Some cycles are exogenous, i.e., induced by external
phenomena, whether natural or cultural. Seasonal rhythms, anniversary effects,
and cycles tied to periodic events (e.g., presidential elections and earnings reports)
fall into the exogenous category: these cycles are best analyzed with methods that
take the timing of the driving events into account. Other cycles are endogenous;
i.e., their external driving forces are not apparent, and nothing other than price data
is needed to analyze them. The 3-day cycle occasionally observed in the S&P 500
is sn example of an endogenous cycle, as is an S-minute cycle observed by the
authors in S&P 500 tick data. Programs based on band-pass filters (Katz and
McCormick, May 1997) and maximum entropy (e.g., MESA96 and TradeCycles)
are good at finding endogenous cycles.
We have already discussed the exogenous seasonal cycles, as well as lunar
and solar rhythms. In Chapter 10, endogenous cycles are explored using a sophis-
ticated wavelet-based, band-pass filter model.


Neural Networks
As discussed in Chapter 11, neural network technology is a form of artiiicial intelli-
gence (or AI) that arose from endeavors to emulate the kind of information pmcess-
ing and decision making that occurs in living organisms. Neural networks (or “nets”)
are components that learn and that are useful for pattern recognition, classification,
and prediction. They can cope with probability estimates in uncertain situations and
with “fuzzy” patterns, i.e., those recognizable by eye but difficult to dehe using pm-
cise rules. Nets can be used to directly detect turning points or forecast price changes,
in an effort to obtain good, predictive, countertrend entry models. They can also vet
entry signals generated by other models. In addition, neural network technology can
help integrate information from both endogenous sources, such as past prices, and
exogenous sources, such as sentiment da@ seasonal data, and intermarket variables,
in a way that benefits the trader. Neural networks can even be trained to recognize
visually detected patterns in charts, and then serve as pattern-recognition blocks with-
in traditional rule-based systems (Katz and McCormick, November 1997).


Genetically Evolved Entry Rules
Chapter 12 elaborates a study (Katz and McCormick, December 1996) demon-
strating that genetic evolution can be used to create stable and profitable rule-
based entry models. The process involves putting together a set of model
fragments, or “rule templates,” and allowing a genetic algorithm (GA) to combine
and complete these fragments to achieve profitable entries. The way the method-
ology can discover surprising combinations of rules that consider both endoge-
nous and exogenous variables, traditional indicators, and even nontraditional
elements (e.g., neural networks) in making high-performance entry decisions will
be examined. Evolutionary model building is one of the most advanced, cutting-
edge, and unusual techniques available to the trading system developer.


STANDARDIZED EXITS
To study entries on their own, and to do so in a way that permits valid comparisons
of different strategies, it is essential to implement a srandardized exit that will be
held constant across various tests; this is an aspect of the scientific method that
was discussed earlier. The scientific method involves an effort to hold everything,
except that which is under study, constant in order to obtain reliable information
about the element being manipulated.
The standardized exit, used for testing entry models in the following chapters,
incorporates the three functions necessary in any exit model: getting out with a prof-
it when the market moves sufficiently in the trade™s favor, getting out with a limited
loss when the market moves against the trade, and getting out from a languishing
market after a limited time to conserve margin and reduce exposure. The standard
exit is realized using a combination of a stop order, a limit order, and a market order.
Stop and limit orders are placed when a trade is entered. If either order is
filled within a specified interval, the trade is complete, the remaining order is can-
celed, and no additional orders are placed. If, after the allotted interval, neither the
stop nor limit orders are filled, they are canceled and a market order is placed to
force an immediate exit from the trade. The stop order, called a money management
stop, serves to close out a losing position with a small, manageable loss. Taking a
profit is accomplished with the limit order, also called a profit target. Positions that
go nowhere are closed out by the market order. More elaborate exit strategies are
discussed in “Part III: The Study of Exits,” where the entries are standardized.
Money management stops and profit target limits for the standardized exits
are computed using volatility units, rather than fixed dollar amounts, so that they
will have reasonably consistent meaning across eras and markets. Because, e.g., a
$1,000 stop would be considered tight on today™s S&P 500 (yet loose on wheat),
fixed-dollar-amount stops cannot be used when different eras and markets are
being studied. Volatility units are like standard deviations, providing a uniform

<< . .

. 8
( : 30)



. . >>