Wednesday, November 24, 2010

Dual Moving Averages ... the Market's Favorite…

Why moving averages are my least favored trading tool

"What moving averages do you use?"

Isn't that a common question? Is there and answer? Of course, many traders use moving averages. Which are the best periods to use then?

My answer: "Depends on how much money you want to lose."

I am fascinated by the market's fascination with moving averages. Why? Am I missing something? I have seen all sorts of strategies using moving averages but have never seen a strategy that is stable and makes steady profit with a low drawdown.

Let's take a look at a simple dual moving average strategy that simply buys when they cross higher and sells when they cross lower. I used this on a chart of the Euro against the Dollar and to begin with I have limited this to a period of five years from the introduction of the Euro in January 1999.

Just to speed up the process I optimized the two periods which ended up as 9 periods for the short moving average and 35 for the long moving average.

Capital $20,000 Leverage 5x EUR 80,000
Total Net Profit 0.4918 Gross Profit 0.8088


Gross Loss (0.3170)
Total # of trades 38 Percent profitable 55.26%
Number winning trades 21 Number losing trades 17
Max intraday drawdown (0.0908) As a % of capital (36.32%)
Largest winning trade 0.1046 Largest losing trade (0.0442)
Average winning trade 0.0385 Average losing trade (0.0186)
Ratio avg win/avg loss 2.0654

1999 0.0983 39.32%
2000 0.1355 54.20%
2001 0.0396 15.84%
2002 0.0759 30.36%
2003 0.1425 57.00%
TOTAL 0.4918 196.72%

Let's look at these numbers.

First of all I took an average rate of 1.25 for the EURUSD rate and came to a position size on a 5x leverage of EUR 80,000. This is probably a bit high, but for the sake of examining just how good a strategy is it will suffice.

Well, we have see 55.26% of the trades make profit and the ratio of profit to loss is over 2:1. That is quite good. The total net profit over the 5 years is 0.4918 – so very nearly 0.1000 per annum. Looking at the results for each year we see the lowest return was 15.84% (2001) and the highest was 57.00% (2003). I'd be happy with that. We've almost trebled our capital in that time although we would have had to have gone through something like a 36.32% drawdown in capital at some point.

These numbers are good!

So on the 1st January 2004 we can start trading… and these would have been the results since then:

Capital $20,000 Leverage 5x EUR 80,000
Total Net Profit (0.0922) Gross Profit 0.2704


Gross Loss (0.3626)
Total # of trades 27 Percent profitable 22.22%
Number winning trades 6 Number losing trades 21
Max intraday drawdown (0.1480) As a % of capital (59.20%)
Largest winning trade 0.0889 Largest losing trade (0.0379)
Average winning trade 0.0451 Average losing trade (0.0173)
Ratio avg win/avg loss 2.6100

2004 (0.0073) (2.92%)
2005 (0.0416) (16.64%)
2006 (0.0128) (5.12%)
2007 (0.0130) (5.20%)
TOTAL (0.0747) (29.88%)

Suddenly the numbers don't look quite so good… Every year has recorded a loss and the maximum drawdown was almost 60% of capital. Only 6 out of the 27 trades made profit over the 3.25 years.

Was there something wrong with the optimization? How could the same moving average periods lose so much money?

I have news… this is very, very common.

The next question is normally "Can I add a money management stop, trailing stop or take profit."

Of course you can but do remember there are two risks involved. To be honest a money management stop should always be employed. However, there can be a downside in that when set to a level with which you feel comfortable it can actually increase the drawdown. What can happen especially with simple moving average systems is that since they provide a lagging entry signal, the subsequent pullback is so deep it will catch the money management stop. This often takes a loss on a position you may have profited from without the stop and if there are too many of these it can actually cause the drawdown much higher.

Trailing Stops and Take Profit Stops are also valid methods to take more control over positions. Here however you will need to avoid optimizing them. If anything they should be set to a non-fixed amounts but reflect market volatility through using volatility. Optimizing these is not recommended. The more variables you put into your system the more unstable it becomes.

The final question is then usually asked. "Is there any way to more thoroughly check whether the optimization has provided a stable result?"

The answer is most definitely yes. Look at the profit results of all the optimized periods. For example, let's look at the strategy above. After optimization the moving average periods used were 9 and 35. Each of these should be examined to observe how stable the results are around the optimum period. Look at the following graphs of results:

On the left are the results of all lengths in the short moving average period from 5 to 12 while on the right are the results of all lengths in the long moving average period from 30 to 40.

Note on the left that around the optimum 9 period average the next best results are around 1,000 points lower and going out to the extremes these move down to 2,000 points lower. Equally, on the right we see a similar result.

It must be understood that when optimizing the chances of seeing profits as high as suggested by the optimum periods are very, very low and thus do not even begin to think that your trading results will be any where close. The best type of result you should be looking for in a type of flat bell curve which sees limited reductions in profit either side of the optimum. Even then, the more variable parameters you utilize the more chance there is of these causing an exponential reduction in profitability in your strategy.

What I have pointed out here with two moving averages is common of a poor strategy but very common using moving averages. They are really not good trading tools.

Sunday, November 14, 2010

Moving Averages as a Forecasting Indicator

There is reason for caution when analysts tell you that moving averages forecast price movement

Many analysts still claim that moving averages can be used to forecast the subsequent day's movement. I'm not sure why this is considered true as none of the tests I have ever done suggest that they are anything less than poor at the role. In fact, almost certainly they would lose money when used in this fashion.

Let me go through a test to highlight the numbers and the risk of loss.

The first test is a simple trading strategy. If the moving average closes higher then the strategy will buy at the next day's opening price and exit at close. In fact, just to try and discover the best parameter for Dollar-Yen I optimized the period used on a daily chart over 5 years from 2002 to 2006 and fount the very best period was a 7 day exponential moving average. The results can be summarized as follows:

Year Profit (in points)
2002: 1,299
2003: (664)
2004: 1,775
2005: (224)
2006: (840)

Total: 2,568

Maximum drawdown: 1,343 points (maximum loss from the equity high point)
% of winning trades: 50.89%
Average Profit: 50 points
Average Loss: 48 points
Ratio of profit/loss: 1 : 1.04

Let's just look at the numbers. First of all the net total over 5 years represents about 500 points a year. If we use a conservative 5x leverage it will represent an approximate 22.5% return a year on average. Not too shabby.

Now let's look at the maximum drawdown, a massive 1,343 points which using the same leverage would have lost you 61% of your capital and would have severely restricted your ability to trade at the same leverage, not even to mention whether you would have just plain given up.

Let's look at something more damning. By necessity chart prices are constructed using the bid price only and thus you should always look at allowing for the 3 point spread. Let me add in a 3 point slippage. The figures now look like this:

Year Profit (in points)
2002: 537
2003: (1,435)
2004: 992
2005: (553)
2006: (840)

Total: (1,299)

Maximum drawdown: 2,181 points (maximum loss from the equity high point)
% of winning trades: 48.25%
Average Profit: 50 points
Average Loss: 48 points
Ratio of profit/loss: 1 : 1.03

Clearly in reality we would have probably made a loss just because of the bid/offer spread! What is more, the maximum drawdown of 2,181 points would have implied a loss of 99% of our capital!

I think that clearly shows that moving averages simply do not forecast the next day's movements. However, in addition to the above the results shown are from using the optimized period. In reality we wouldn't know the optimum period until after the fact and would have to hope that the period chosen would continue to make the same level of profits. I have met many traders who think this is a reasonable assumption.

Well, to dispel any such ideas let me show you the graph of the profit/loss across the range of optimization periods which I organized from 3 to 30:

Out of 28 periods used only 9 actually produced profit. The 7 period average made the most at 2,568 points (before allowing for the spread) while the next best profit was the 6 period average which only made 1,620 points. When allowing for the spread no period of moving average made any profit at all.

I hope this puts to rest the claim that moving averages can be used to forecast price.

Thursday, November 4, 2010

Using Support and Resistance Levels

A guide to determining approximate reversal levels

Support and resistance is a tool which is often used but quite often the source of the support and resistance levels are not often completely obvious. There are several ways to derive these levels:

  1. Previous support remains supportive until broken and vice versa
  2. Previous support becomes resistance and vice versa in pivot levels
  3. Fibonacci derived support and resistance either by retracement or projections

The third method is the most accurate but the process of learning how to calculate these using the right levels requires a large degree of experience and skill using Elliott Wave. I shall therefore concentrate on the first two in this article.

In the image above the upper chart is of daily Dollar-Yen while the lower is the weekly chart.

Now the first thing to remember is that trends are developed when (in an uptrend) highs are moving higher and lows are moving higher. In a downtrend the lows are moving lower while the highs are also moving lower.

Thus when in an uptrend the most recent low is broken we need to decide where price might finally make a corrective low.

For example, we can see in the daily chart that price rallies to the 121.38 high at point (1). It then reverses, breaking below previous lows in the uptrend. So now we know the uptrend is reversed but where will the decline reach?

In the weekly chart we can see two prior lows around 115.50 which also provided resistance in an earlier correction. It is this pivot area where the first decline to point (a) completes. The correction to point (b) can often be measured by Fibonacci retracements and in the case it was 76.4%.

The next decline in the daily chart to point (2) reaches 108.96. This is just 26 points above the last major low at 108.70 before the rally to 121.38. It is very frequent that the first retracement will move to the most recent major low (after a rally) or the most recent high (in a decline). A horizontal line has been marked on the weekly chart to show this support area.

Now that we have identified the approximate area of the low and we see a recovery we can begin to look at where this may reach. We should remember the pivot area around 115.50 although while it did see a reaction for a few days price quickly broke through and we then need to look for the next resistance.

Here is a little tip that can be useful. Where you see a very distinctive 3-leg move as we did from the 121.38 high down to 108.96, the retracement will quite often move to the extreme of the middle correction - in this case at point (b). The high was at 119.38 and the rally to Point (c) ended at 119.87 - just 50 points above.

From the 119.87 peak we can see how price then declined and penetrated the series of supporting lows so we then look at the 115.50 pivot area again but since this didn't hold too well on the way up we can begin to look at the series of lows that spread across from the 113.41 low at Point (a) and the last major low which was at 113.95. We should expect the correction lower to find a correction close to the 113.41-95 area. In the end the correction ended at 114.42 at Point (3).

The next rally then moves up to retest and break the 121.38 high at Point (4). We may have been tempted to call price higher then but the break below the corrective lows signaled a reversal lower which has been declining back towards the 113.41-114.41 lows and still may just get there.

Of course, using support and resistance areas in this way is an approximation and it should not be expected to find accurate or final support or resistance levels but can be useful in determining the basic direction. Certainly as price approaches these levels you should always be looking at the lower time-frame chart to spot reversal patterns or breaks of short time-frame trend lines and also of the most recent lows/highs that would indicate a reversal.