<< . .

. 18
( : 30)



. . >>

shorts, the opposite of what was frequently seen in tests of other models.
Equity steadily declined from the beginning to the end of the data series for
entry at open. For entry on limit, equity was choppy but up, peaking in September
1989. It then declined until July 1992, rose slightly until February 1994, and
declined steadily until July 1998, when it suddenly began increasing. With a stop,
equity showed a choppy decline from one end of the data series to the other.
In-sample, the number of markets with positive returns using a limit, a
market-at-open, and a stop were 15, 8, and 7, respectively. Out-of-sample, the
limit produced the best results (17) followed by the market-at-open (16), and
the stop (14). More market-order combinations produced profits out-of-sample
than in-sample; it seems that many markets are becoming more affected by lunar
rhythms in recent years. In-sample, only the Deutschemark and Light Crude
were profitable across all three entry orders. Out-of-sample, the Deutschemark
was highly profitable with limit and stop orders; Light Crude slightly lost with
the stop. T-Bonds strongly profitable in both samples with the limit. Pork Bellies
was profitable in both samples with entry at open and on limit. Considering only
the limit order, profit in both samples was observed for the Deutschemark, Swiss
Franc, Japanese Yen, Platinum, Palladium, Sugar, and Cotton.

Tests of the Basic Momentum Model
A centered moving average smoothed the unintegrated lunar price change series.
No lag was induced because the centered average examines as many future (rela-
tive to the current bar), as it does past, data points. This smoothing is legitimate
because, in the calculations, the lunar estimate at the current bar involves data at
least two lunar cycles (about two months) away. For the smoothed lunar price
changes, a series of average absolute deviations was computed and a loo-bar sim-
ple moving average was taken to produce the desired result. A buy was issued
when lunar momentum, at the current bar plus some displacement (d&p), was
greater than some multiple (thresh) of the average absolute deviation of the lunar
momentum. A sell was issued when lunar momentum, at the same displaced bar,
was less than minus the same multiple of the average absolute deviation. Entries
were executed at the open (Test 4), on a limit (Test S), or on a stop (Test 6).
Optimization was for the length of the moving averages (stepped from 5 to
15 in increments of 5), the displacement (1 to 10 in steps of l), and the threshold
(1.5 to 2.5 in steps of 0.5). Best results were achieved with the length, displace-
ment, and threshold parameters set to 10, 10, 2 for the market-at-open and 15, 9,
1.5 for the limit and stop.
Overall, results were worse than for the crossover model. Heavy losses
occurred in both samples across all order types. The same poor performance was
observed when seasonal effects were analyzed with the momentum model. Longs
again performed better than shorts.
With entry at open, portfolio equity declined smoothly and severely, with the
rate of loss gradually decreasing over time. With a limit order, equity steadily
decreased. With a stop, equity dropped sharply from the beginning of the sample
until August 1988, then declined gradually.
In-sample, the S&P 500, NYFE, Deutschemark, and Swiss Franc were
somewhat profitable across all orders. Out-of-sample, the S&P 500 and NYFE
neither profited nor lost, but the Deutschemark did well with entry at open, and the
Swiss Franc with entry on limit and on stop. As with the crossover model, there
were many more profitable market-order combinations.

Tests of the Crossover Model with Confirmation
This is identical to the basic crossover model except that entries were only taken
when an appropriate reading of the Fast %K Stochastic confirmed lunar market
behavior. Specifically, if the lunar crossover suggested a buy, it was only acted
upon if Fast %K was below 25%; before a buy occurred, the market had to be
down or near a bottom, as expected on the basis of the lunar rhythm. Likewise, a
lunar sell was not taken unless the market was near a possible top, i.e., Fast %K
greater than 75%. Entries were at the open, on a limit, or a stop (Tests 4 to 6,
respectively).
The length of the moving averages (avglen) was optimized from 3 to IS in
increments of 3, and displacement (disp) from 0 to 15 in increments of 1. Best per-
formance was achieved for entry at the open, and on a limit, with a moving aver-
age length of 15 and a displacement of 12; the best stop entry occurred with a
length of 12 and a displacement of 5.
In-sample, the results were somewhat better than the basic crossover model:
When combined with the stop, the crossover with confirmation yielded about $234
per trade. Out-of-sample, however, the average loss was more than for either of the
previous two models, regardless of order. The stop showed the smallest loss per
trade and was best. This is another system not profitable on a whole portfolio
basis. The equity curves showed nothing but losses across all three orders.
In-sample, the JapaneseYen, Heating Oil, Soybeans, and Soybean Meal were
profitable with all three orders; out-of-sample, only losses or, at best, unprofitable
trading occurred in these markets. Kansas Wheat showed consistent behavior
across samples: Results were profitable with entry at open and on limit, and
unprofitable with entry on stop. Across samples, the British Pound and Swiss
Franc were profitable, as was the Canadian Dollar, Eurodollar, and Pork Bellies
with entry on a stop. Since the number of trades was fairly small for many mar-
kets and the whole portfolio, results are probably not trustworthy.

Tests of the Crossover Model with Confirmation
and Inversions
This is the same as the crossover model with confirmation, but additional trades
were taken at possible inversions. If a lunar buy was signalled by a crossover,
but the market was high (Fast %K being greater than 75%), a sell (not a buy) was
posted; the assumption is the usual lunar cycle may have inverted, forming a top
instead of a bottom. Likewise, if the crossover signalled a sell, but the market
was down, a buy was issued. These signals were posted in addition to those
described in the crossover with confirmation model. Entries occurred at the open
(Test lo), on a limit (Test ll), or a stop (Test 12).
The length of the moving averages (avg2en) was stepped from 3 to 15 in
increments of 3, and the displacement (disp) from 0 to 15 in increments of 1. For
entry at the open, the best moving average length was 15 and displacement, 12;
entry on a limit was best with a length of 15 and a displacement of 8; entry on a
stop required a length of 12 and displacement of 15.
This model lost heavily across samples and orders. As with seasonality,
inversions did not benefit performance. The equity curve paints a dismal picture.
In-sample, the NYFE was profitable across all three orders, but the S&P 500
lost for two of the orders and was flat for the other. The Swiss Franc was also prof-
itable in-sample across all three orders; out-of-sample, it was very profitable for
entry at open, but lost for the other two orders. There was a great deal of incon-
sistency in results between the samples.

SUMMARY ANALYSES
When considered over all models, the stop performed best in both samples. The
worst performers were, in-sample, the open and, out-of-sample, the limit. In-sample,
when considered over all order types, crossover with confirmation was the best. Out-
of-sample, the basic lunar crossover model performed best and crossover with con-
tirmation worst.
There were many strong interactions between sample, model, and order. Some
of the results stem from the small number of trades. The best of the seasonal model-
order combinations yielded better and more consistent performance than the best of
the lunar ones.

CONCLUSION
When entire portfolios are considered, entry models based on lunar rhythms do
not do as well as those based on seasonal rhythms. The poor showing of the lunar
effect contradicts our earlier study (Katz and McCormick, June 1997). The differ-
ences may stem from two possible factors: entry models and exits. In the current
tests, the models were optimized on an entire portfolio, which may not be appro-
priate for the lunar rhythm (the earlier model entered the market a specified num-
ber of days after full or new moon). The methods used in this chapter were altered
from the previous study because of the need to optimize using common parame-
ters across all markets. Doing this with the earlier approach would require that
trades be entered n-days after the full or new moon, regardless of the market being
traded; since lunar rhythms are distinct for each market (as demonstrated in our
previous study), this approach was inappropriate. The earlier model was, there-
fore, redesigned to be self-adaptive, i.e., as it proceeds through lunar cycles, the
appropriate timing for trading is decided by analysis of previous lunar cycles.
Another possible reason for the conflicting results may be the interaction
between the exits and entries, The lunar model, and perhaps the seasonal model,
has the property of pinpointing tradeable tops and bottoms, but only a percentage
of the time. Such systems work best with very tight stops that quickly cut losses
when predictions go wrong, but that allow profits to accumulate when correct.
In general, the lunar models performed poorly, but there were individual mar-
kets with consistent, positive performance-encouraging, given the model was not
optimized to them. Results suggest that some great systems are hiding here if
entries were tailored to them, e.g., in our earlier study, the lunar model traded Silver
well; in the current study, Silver was not strongly responsive. Although the lunar
models lost money on the portfolio, they lost very much less on a per-trade basis
than did, for instance, most moving average and oscillator entry models.

SOLAR ACTIVITY AND TRADING
An earlier study (Katz and McCormick, September 1997) examined the effects of
sunspots on the S&P 500 and Wheat. In-sample, a simple sunspot model pulled
$64,000 from the S&P 500 between 1984 and 1992. There were 67 trades, 31%
profitable. The average winning trade was $5,304.76, much larger than the average
loser (-$1,030.43). The average trade was $955.22 with a return of 561% (not annu-
alized). The long side was profitable, but the short side was substantially more so,
highlighting the tendency of unusual solar activity to coincide with market crashes.
The better performance of short trades is especially significant, since this market
was in a secular uptrend during most of the testing period. Profitability continued
out-of-sample, from 1993 through 1996, with a 265% return, 23 trades (30% prof-
itable), and with an average trade yielding $891.30. The results for Wheat were also
good across samples. In-sample, 57% of X4 trades were profitable with a $203.27
average trade and 859% return (not annualized). Out-of-sample, there were 29
trades, 55% profitable, a $260.78 average trade, and 406% return.
Our initial research suggested further study would be worthwhile. The tests
below examine the effects of solar activity on the standard portfolio. Daily sunspot
numbers from 1985 through 1999, from the Royal Observatory of Belgium, were
used to generate entries.

GENERATING SOLAR ENTRIES

There are many ways to generate entries based on solar activity. The method used
below is a simple variation of a breakout model, applied to sunspot counts, not prices.
The rules are: If the current sunspot number is higher than the cument upper thresh-
old, and the sunspot counts for a certain number (I&?) of previous bars were lower
than their corresponding thresholds, then either a buy or sell signal (depending on
previous market behavior in response to upside breakouts in the sunspot numbers) is
issued. If the current sunspot number is lower than the current lower threshold, and
the sunspot counts for the same number of previous bars were all higher than their
corresponding thresholds, then either a sell or a buy signal (again, depending on pre-
vious market behavior) is issued. The signals are not responded to immediately, but
only after a specified number of days (disp). The breakout thresholds are determined
as follows: The upper threshold, used for a given bar, is the highest sunspot number
found in a certain larger number of previous bars (Ibl), while the lower threshold is
set at tbe lowest of the sunspot numbers in those previous bars. “Previous market
behavior” refers to whether the market was near the bottom or top of its near-future
range when a paaicular kind of breakout occurred. If a given direction of solar breal-
out is historically associated with the market being near the bottom of its near-future
range, a buy signal is generated, on the other hand, if the market is characteristically
near the top of its near-future range, a sell signal is generated.
Like lunar phenomena and seasonality, entries based on solar activity share
the assumption that market behavior is intluenced by external factors and that the
independent, influential variable has predictive value, i.e., market behavior is
anticipated rather than responded to. As with any predictive system, the forecasts
may be more or less correct. Trades resulting from incorrect predictions can be
incredibly bad, even if many trades resulting from correct predictions are perfect,
as is often the case with predictive systems. Being anticipatory, the models lend
themselves to countertrend entries, which means better tills, less slippage, and bet-
ter risk control, assuming appropriate stops are used (not done here because of the
need to maintain the standard exit).
199
CHAPTER 9 Lunar and mar Rhythms


The code for these tests is similar to that for lunar analysis and so is not pre-
sented here. It is available on the companion software CD (see offer at back of
book).

SOLAR TEST RESULTS
Tests were performed on the solar entry model using entry at open (Test 1). on a
limit (Test 2), and on a stop (Test 3). The breakout look-back (Ibl) was stepped
from 25 to 40 in increments of 5; the repeat prevention look-back (lb,?) from 10 to
15 by 5; and the displacement (disp) from 0 to 2 by 1. For entry at the open, the
best in-sample performance was with a breakout look-back of 35, a repeat pre-
vention look-back of 15, and a displacement of 2. For the limit, a breakout look-
back of 40, a repeat prevention look-back of 15, and a displacement of 0 were
optimal. For the stop, the best values were: for the breakout look-back, 35; for the
repeat prevention look-back, 15; and for the displacement, 2.
Table 9-4 shows both the in- and out-of-sample performance for specific
commodities. The columns and rows contain the same kinds of data as in Tables
9-2 and 9-3 above.
The solar model performed about as well as the lunar ones and, in sample,
did best with a stop order. In-sample, entry at the open was worst (-$I631 per
trade); a limit was slightly better (-$1519), substantially so when only long trades
were considered. The stop order was the best, losing only $52 per trade; were it
not for transaction costs, this order would have been very profitable in-sample.
The mode1 required the theoretically expected displacement. The best dis-
placement for the limit was zero, understandable since the goal is to respond
quickly, before the market turns, when a limit can enter on the noise. With the stop,
a displacement of 2 was best: Movement needs to begin to trigger the stop and
cause entry. The average loss per trade worsened, from -$52 to -$2,000, when dis-
placement deviated just one or two bars from its optimal value. This implies a rela-
tionship between the timing of the market and solar events otherwise small
changes in the displacement should have little or no effect.
With the stop order, the highest percentage of wins (in-sample) was obtained
and the long side was actually profitable. Out-of-sample, the stop was again best,
but the average loss per trade was a substantial $1,329.
Equity was examined only for the stop, since the other orders performed so
poorly. Equity rose very rapidly until June 1988, then, until October 1990, it was
choppy and fairly flat. Between October 1990 and June 1994, equity declined
sharply, then was choppy and slightly down.
Interestingly, some of our previous findings (Katz and McCormick,
September 1997) were confirmed. With the stop, which generally performed best
on the whole portfolio, the S&P 500 was very profitable in both samples. The
average trade returned $4,991 in-sample: the return was 20.4% annualized; and,
200



TABLE B-4

PWformance Broken Down by Sample, Test, and Market


Iln-sample 1 1 Counil lout-of-sample 1 Count
1
SYM 101 102 103 1 I IO1 102 103
I I I++ I II - **
SP
the t-test indicated a greater than 80% probability that the effect was real and
would hold up. Both long and short trades were profitable. In-sample there were
37 trades (40% winners). Out-of-sample, longs and shorts both continued to be
profitable; it was surprising that the shorts were profitable because the market was
in a steep up-trend during most of that period. Out-of-sample, the return was
39.5% annualized, with an 80% probability of being real; there were 11 trades
(45% winners), and the average trade returned $5,640. These are excellent results.
The observation that sharp down-turns can occur after solar flares has been
supported. With the stop order, Minnesota Wheat, Soybeans, and Cotton were also
profitable in both samples. Minnesota Wheat pulled 13.5% annually in-sample,
again with a better than 80% chance of the results being real, and 30.5% out-of-
sample, with almost an 85% probability of the effect not being due to chance.
Interestingly, Light Crude and Heating Oil were highly profitable in-sample, but
lost moderately out-of-sample. There were a few profits in other markets, but no
consistency between in- and out-of-sample performance with the stop.

CONCLUSION
Like seasonality and lunar phase, solar activity appears to have a real influence on
some markets, especially the S&P 500 and Minnesota Wheat. As with lunar
cycles, this influence is not sufficiently strong or reliable to be a primary element
in a portfolio trading system; however, as a component in a system incorporating
other factors, or as a system used to trade specific markets, solar activity is worth
attention. We personally do not believe solar influences directly determine the
market. We do suspect that they act as triggers for events that are predisposed to
occur, or as synchronizers of already-present market rhythms with similar period-
icities. For example, if a market is highly over-valued and unstable, as was the
S&P 500 in October 1987, a large solar flare might be sufficient to trigger an
already-imminent crash.

WHAT HAVE WE LEARNED?

. Lunar and solar phenomena may have real impact on commodities mar-
kets. In the case of solar phenomena, such impact on the S&P 500 has
been conhrmed. With lunar phenomena, there is more inconsistency in
the results, but influence is clearly detectable.
n The phenomena are probably worth including in a more elaborate trading

model, e.g., as inputs to a neural network.
n Models that capture such influences almost certainly need to be tuned to

specific markets in a more effective way than has been done here. Such
market specificity might be the reason for the better results observed
when tests were conducted on individual markets.
202




. As with other countertrend models that pinpoint turning points (including
seasonality), it is probably necessary to use an exit that includes a fairly
tight stop. If a turning point is correctly identified, the stop is never hit
and the trade quickly turns profitable. On the other hand, when a predic-
tion error occurs, as frequently happens, the stop quickly kills the trade,
cutting losses short. The use of tight stops may be another factor that
accounts for better performance in our earlier studies (Katz and
McCormick, June and September 1997) than in the current tests.
. Given the highly probable influence of solar and lunar rhythms on certain
markets, it might be worth exploring some other planetary rhythms,
including the kinds of planetary configurations and cycles that are the
focus of astrologers.
. Entry orders interact with models. Limit orders, for example, do not
always perform best. It seems a stop order sometimes improves perfor-
mance. The reason may be that a stop order introduces verification of the
beginning of a trend before entry can occur, something that may be
important when using a prediction-based counter-trend strategy.
CHAPTER 10


Cycle-Based Entries




A cycle is a rhythmic oscillation that has an identifiable frequency (e.g., 0.1
cycle per day) or, equivalently, periodicity (e.g., 10 days per cycle). In the previ-
ous two chapters, phenomena that are cyclic in nature were discussed. Those
cycles were exogenous in origin and of a known, if not fixed, periodicity.
Seasonality, one such form of cyclic phenomena, is induced by the periodicity and
recurrence of the seasons and, therefore, is tied into an external driving force.
However, while all seasonality is cyclic, not all cycles are seasonal.
In this chapter, cycles that can be detected in price data alone, and that do not
necessarily have any external driving source, are considered. Some of these cycles
may be due to as yet unidentified influences, Others may result only from reso-
nances in the markets. Whatever their source, these are the kinds of cycles that
almost every trader has seen when examining charts. In the old days, a trader
would take a comb-like instrument, place it on a chart, and look for bottoms and
tops occurring with regular intervals between them. The older techniques have
now been made part of modem, computerized charting programs, making it easy
to visually analyze cycles. When it comes to the mechanical detection and analy-
sis of cycles, ma*imum entropy spectral analysis (MESA) has become the preem-
inent technique.

CYCLE DETECTION USING MESA
Currently, there are at least three major software products for traders that employ the
maximum entropy method for the analysis of market cycles: Cycle Trader (Bressert),
MESA (Ehlers, 800.633.6372), and TradeCycles (Scientific Consultant Services,
516-696-3333, and Ruggiero Associates, 800-21 l-9785). This kind of analysis has
204




been found useful by many market technicians. For example, Ruggiero (October
1996) contends that adaptive breakout systems that make use of the maximum
entropy method (MEM) of cycle analysis perform better than those that do not.
Maximum entropy is an elegant and efficient way to determine cyclic activity
in a time series, Its particular strength is its ability to detect sharp spectral features
with small amounts of data, a desirable characteristic when it comes to analyzing
market cycles. The technique has been extensively studied, and implementations
using maximum entropy have become polished relative to appropriate preprocess-
ing and postprocessing of the data, as required when using that algorithm.
A number of problems, however, exist with the maximum entropy method,
as well as with many other mathematical methods for determining cycles. MEM,
for example, is somewhat finicky. It can be extremely sensitive to small changes
in the data or in such parameters as the number of poles and the look-back period.
In addition, the price data must not only be de-trended or differenced, but also be
passed through a low-pass filter for smoothing before the data can be handed to
the maximum entropy algorithm; the algorithm does not work very well on noisy,
raw data. The problem with passing the data through a filter, prior to the maximum
entropy cycle extraction, is that lag and phase shifts are induced. Consequently,
extrapolations of the cycles detected can be incorrect in terms of phase and timing
unless additional analyses are employed.

DETECTING CYCLES USING FILTER BANKS
For a long time, we have been seeking a method other than maximum entropy to
detect and extract useful information about cycles. Besides avoiding some of the
problems associated with maximum entropy, the use of a novel approach was also
a goal: When dealing with the markets, techniques that are novel sometimes work
better simply because they are different from methods used by other traders. One
such approach to detecting cycles uses banks of specially designed band-pass fil-
ters. This is a method encountered in electronics engineering, where filter banks
are often used for spectral analysis. The use of a filter bank approach allows the
bandwidth, and other filter characteristics, to be tailored, along with the overlap
between successive filters in the bank. This technique helps yield an effective,
adaptive response to the markets.
A study we conducted using filter banks to explore market cycles produced
profitable results (Katz and McCormick, May 1997). Between January 3, 1990,
and November 1, 1996, a filter bank trading model, designed to buy and sell on
cycle tops and bottoms, pulled $114,950 out of the S&P 500. There were 204
trades, of which 50% were profitable. The return-on-account was 651% (not annu-
alized). Both the long and short sides had roughly equal profitability and a similar
percentage of winning trades. Various parameters of the model had been opti-
mized, but almost all parameter values tested yielded profitable results. The para-
meters determined on the S&P 500 were used in a test of the model on the T-Bonds
without any changes in the parameters, this market also traded profitably, retum-
ing a 254% profit. Given the relative crudeness of the filters used, these results
were very encouraging.
In that study, the goal was simply to design a zero-lag filtering system. The
filters were analogous to resonators or tuned circuits that allow signals of certain
frequencies (those in the pass-band) to pass through unimpeded, while stopping
signals of other frequencies (those in the stop-band). To understand the concept of
using@ers, think of the stream of prices from the market as analogous to the elec-
trical voltage fluctuations streaming down the cable from an aerial on their way to
a radio receiver. The stream of activity contains noise (background noise or “hiss”
and static), as well as strong signals (modulated cycles) produced by local radio
stations. When the receiver is tuned across the band, a filter™s resonant or center
frequency is adjusted. In many spots on the band, no signals are heard, only stat-
ic or noise. This means that there are no strong signals, of the frequency to which

<< . .

. 18
( : 30)



. . >>