REFINING THE
TESTING
When
testing different patterns and various filters, I am looking for clear and
convincing evidence that the pattern has worked well and that filters have an
obvious positive impact on results. Backtesting shows the results for trading
all of the patterns that occur during the test period and the ROI is
annualized. That’s why traders will not see these exact numbers; they likely
will not take every trade that presents itself and will usually not annualize
their own results during short periods of time.
If
a filter, such as the volume ones tested previously, has test results that show
a few points difference in annualized ROI or a few points difference in the
percentage of winning trades, it does not mean much. When a pattern or filter
shows dramatic improvements in several different test periods, then I have more
confidence the results are due to characteristics of the pattern or filter. An
example of this is the dramatic difference found between test results of the
hanging man pattern in bullish and bearish market environments. This large and
consistent difference is unlikely due to chance and more likely due to the
effects of the market environment.
Now
that we know the best market environment in which to use the hanging man
pattern, we should look at several other filters to see if there are parameters
of the pattern itself that strongly influence results. If there are, then we
can use them to improve trading results. If we do not find any, then we can
just focus on trading the basic pattern in bear markets.
PRICE FILTER
The
basic hanging man pattern during the 01/03/06 to 05/01/ 07 test period yielded
47% winning trades and an 8% annualized ROI loss. Adding a requirement to the
basic pattern to filter out all stocks with a closing price below $20 bumped up
the annualized ROI to a loss slightly under 6% and left the winning percentage
about the same. Neither of these results is the type of clear improvement we
are looking for. The results were similar when adjusting the filter to
eliminate all stocks with closing prices less than $40. The price level of the
hanging man pattern does not appear to be a filter worth pursuing.
VOLUME FILTER
Table 5.1 shows the results of testing the
hanging man pattern with a series of minimum average volume requirements. The
tests were run during the same period of 01/03/06 to 05/01/ 07. The first
column in Table 5.1 shows the minimum
requirement for the 21 day simple moving average of the volume; the second
column is the annualized ROI; the third column is the percentage of winning
trades. The results do not provide a clear indication that traders should
factor minimum average volume requirements into the trading decision.
TABLE 5.1 HANGING MAN TEST RESULTS FOR MIN. AVG.
VOL. DURING 01/03/06 TO 05/01/07
HIGHEST HIGH
REQUIREMENT
When
looking at the actual positions traded during several of these tests, I noticed
that in a number of cases the hanging man seemed to work when it occurred as a
recent high. An example of this is shown in Figure
5.12, in which a hanging man occurred in ATI on 12/11/06, as marked by
the down arrow. In this case, the day’s high of the hanging man pattern was the
highest high over five days.
FIGURE 5.12: HANGING MAN IN ATI ON 12/11/06 IS
HIGHEST HIGH
Sometimes
we notice things and it is just a fluke that several patterns worked with a
particular characteristic. The only way to know if it is a coincidence or a
real result is to test the characteristic in question. Figure
5.13 shows the results of testing the basic hanging man pattern during
the 01/03/06 to 05/01/07 test period with the added requirement that trades are
only taken if the high on the day the hanging man occurred was the highest high
of the last five trading sessions.
FIGURE 5.13: RESULTS FOR HANGING MAN IS
HIGHEST HIGH DURING JAN. 2006 TO MAY 2007
The
highest high of the last five day’s requirement turned the hanging man pattern
from a net loser during the test period into a net gainer. It also increased the
winning percentage from 47% to more than 50%. The annualized ROI for the period
was still below buy and hold; however, when a filter turns something from a net
loss to a net gain and increases the winning percentage, it is worth noting.
During
the testing process for the hammer pattern in Chapter four, we found that a
filter for the widest range of the last five trading sessions improved the
results. Using the same filter for the hanging man pattern during the test
period of 01/03/06 to 05/01/07 produced the results shown in Figure 5.14. Once again, a filter that helps one
trading pattern does not necessarily help a different pattern. Each trading
pattern stands by itself, and filters must be tested with each different
pattern.
FIGURE 5.14: WIDE RANGE HANGING MAN TEST
RESULTS DURING JAN. 2006 TO MAY 2007
MACD OSCILLATOR AS
A FILTER
It
would be great if there were a couple of filters or, better yet, indicators
that always improved trading results. There are hundreds of different
indicators such as MACD, stochastic, relative strength, etc., that are
available in charting packages. Many traders use these to time the market
without having extensively tested them to see if they work. Some provide
interesting results, many do not, but then that is a topic for another book.
As
an example, some traders use the MACD or the MACD oscillator to time the market
by trading long when the MACD oscillator is positive and trading short when the
MACD oscillator is negative. In effect, they are looking for a bullish market
when the MACD oscillator is positive and a bearish market when the MACD
oscillator is negative.
We
have found the basic hanging man pattern performs dramatically better in
bearish markets than in bullish markets. So given that, some traders might
think to use the MACD oscillator to time the market and determine when to take
hanging man trades and when to avoid them.
Figure 5.15 shows the test results for the
same 01/03/06 to 05/ 01/07 test period used in the initial backtest shown in Figure 5.4. Only taking trades when the MACD
oscillator is less than zero during this period decreased both the annualized
ROI and the percentage of winning trades. For this particular pattern and time
frame, the MACD oscillator is not an effective timing tool. Once again, it is
dangerous to assume something will work without first testing it.
FIGURE 5.15: HANGING MAN RESULTS USING MACD
OSC. TIMING JAN. 2006 TO MAY 2007
One
idea frequently used in trading patterns is that of confirmation. One form of
confirmation is to look for a trading pattern, and then to not take the trade
unless the stock is moving in the desired direction the next day. Since the
hanging man is supposed to mark the end of an uptrend, we could look for the
stock to be down the day following the occurrence of the pattern as
confirmation. An example of this is shown in Figure 5.16, where the hanging man
pattern occurred in WCC on 05/08/06 as noted by the up arrow. The next day, WCC
closed down, which provided the confirmation, and the stock dropped 14% during
the next three trading sessions.
FIGURE 5.16: HANGING MAN IN WCC WITH
CONFIRMATION
The
idea of confirmation can be tested by looking for hanging man patterns on day
one, then requiring that on day two the close be lower than the close on day
one. During the 01/03/06 to 05/01/07 test period, trading only confirmed
hanging man patterns resulted in worse results than just trading the basic
hanging man pattern. The test results are shown in Figure
5.17, and they indicate that the annualized ROI loss increased to more
than 16% and the percentage of winning trades decreased to just more than 45%.
FIGURE 5.17: HANGING MAN WITH CONFIRMATION
TEST RESULTS
DIFFERENT HOLDING
PERIODS
Up
to this point, all tests have used a five-day holding period. The position is
entered at the opening the day after the hanging man pattern forms, held for
five days, and then sold. Table 5.2 shows
the results of using different holding periods. As holding periods decreased,
the annualized ROI bounced around slightly but did not show a clear trend. The
percentage of winning trades increased slightly every time the holding period
was decreased.
TABLE 5.2 HANGING MAN HOLDING PERIOD TEST
RESULTS DURING 01/03/06 TO 05/01/07
While
the data shows a slight improvement in the percentage of winning trades for
shorter holding times, experience tells me it is not significant enough to
focus on. There are a number of different things that can influence actual
trading results as compared to backtesting, such as the number of trades taken,
slippage, the trader’s risk tolerance, etc.
Because
of these factors, I do not incorporate a parameter into my actual trading unless
backtesting in multiple time frames shows clear and compelling evidence that
the parameter strongly influences results. For example, trading the pattern
only in bearish market environments or when the pattern occurs at the highest
high of the last five days has been shown to strongly impact results and is
worth factoring into my trading. A couple of points difference in the winning
percentage are not enough to be useful on a practical basis.
MOVING AVERAGE TEST
FEATURING THE 200 DAY
When
shorting stocks, some traders like to look at tickers that are trading below
their 200 day moving average. They feel that since some mutual funds ignore
these stocks, there is less demand and they tend to drop easier. Like a lot of
things we are told, it sounds interesting; however, in trading it is about what
works.
Figure 5.18 shows the test results for all
hanging man patterns that occurred below their 200 day simple moving average
during the 01/03/06 to 05/01/07 test period. Using the 200 day moving average
as a filter significantly reduces the percentage of winning trades, and still
results in a loss for the test period.
FIGURE 5.18: TEST RESULTS FOR HANGING MAN
PATTERNS BELOW THEIR 200MA
If
instead of looking for hanging man patterns that occur below the 200 day simple
moving average we look for patterns that form above short term moving averages,
the test results are different. Table 5.3 shows
the results of testing hanging man patterns between 01/03/06 and 05/01/07 and
only taking trades when the stock closed above one of the short term moving
averages listed.
TABLE 5.3 HANGING MAN MOVING AVERAGE FILTER TEST
RESULTS FOR 01/03/06 TO 05/01/07
Taking
trades that are above the 20 or 30 day moving averages does not show a
significant difference when compared to tests without a moving average filter.
The results for the shorter 5 and 10 day moving averages are more interesting
and show an improvement in annualized ROI. Stocks that are above a long term
moving average can have a variety of patterns. They could be basing or pulling
back or moving up rapidly. Stocks that are above a short term moving average
are more likely moving consistently up. They may be primed for a pullback when
the hanging man pattern occurs.
Being
above a short term moving average may find patterns similar to the highest day
of the last five days’ requirement, which was found to improve results as shown
in Figure 5.13. When the filters for highest
high in the last five days and above the five day simple moving average were
combined and used together, the results were not significantly different than
those of Figure 5.13. This is another
example of how traders should not look to combine a bunch of filters that
improve results. Filters interact and overlap and each combination should be
tested on its own.