MACD Histogram

Nick Best

Newbie
Messages
5
Likes
0
I am a mere novice in terms of trading and would like some help and thoughts from someone with some experience on the following.

I was trying to backtest MACD histogram models yesterday so that I went long at a an upwards change in direction of a histogram and sold on this reversing.

In backtesting this, I got some good success testing against 2003 data. On most randomly selected groups of shares I got between 20% and 40% return.

However when tested against 2002 data, it lost without fail. I assumed this was because the market generally was in a downtrend and I was going long so put in a filter so a trade would only be accepted if the 25 day moving average was above the 30 day moving average - assuming this would ensure I only bought on uptrends. I still got loss after loss.

Can anyone give me some advice on this use of this indicator. When to use it, when not to, which shares it works for, which it doesn't (and why).


For anyone with amibroker - the code I've been using is as follows:

PositionSize=-10;//this means that 10% of current portfolio is invested each time

H0 = MACD() - Signal ();
H1 = Ref (MACD(), -1) - Ref (Signal(),-1);
H2 = Ref (MACD(), -2) - Ref (Signal(),-2);
H3 = Ref (MACD(), -3) - Ref (Signal(),-3);
H4 = Ref (MACD(), -4) - Ref (Signal(),-4);
H5 = Ref (MACD(), -5) - Ref (Signal(),-5);
H6 = Ref (MACD(), -6) - Ref (Signal(),-6);

a25=EMA(Close,25);
a30=EMA(Close,30);

Buy = H0>H1 AND H1>H2 AND H2<H3 AND H3<H4 AND H4<H5 AND a25>a30

Sell = H0<H1 AND H1<H2 AND H2>H3 AND H3>H4 AND H4>H5;

ApplyStop (0,1,15,0)
 
Nick, the standard use of the MACD histogram are to SELL when the histogram has peaked and is turning down, and BUY when the histogram is turning up after forming a trough.

This seems to be pretty much the way you are interpreting it.

Doesn't explain the differences between your 2002/2003 backtest result though.
 
Nick

I trade utilising MACD ( index/currency futures )

The one thing you do not mention in your post is the timescale of the chart you are using but a couple of pointers may help.

Just using the Histogram for crossovers of the centre line as you have found is very difficult to generate consistant clear signals, one option is to filter off a higher frame chart, I use a timing chart one third of my filter chart i.e. 1 min chart will be filtered off a 3 min chart or 5 min will be filtered off a 15 min chart, therefore only allow yourself to trade in the direction of the prevailing trend.

Also I plot the signal lines onto the histogram massive relevance in whether the crosover is +ive or -ve.

Very good signals are also confirmed by divergance of price against histogram and price against signal lines.

U.S. open calls HTH
 
One Eyed Shark

Thanks for that.

Also I plot the signal lines onto the histogram massive relevance in whether the crosover is +ive or -ve.
So, do you mean that its best to buy when the signal lines are negative, rather than just buying on any change in direction of the histogram?

U.S. open calls HTH

Sorry for the stupid question but what does this mean?
 
Nick

Where the crossover happens on the signal line (+/-) does have big implications.

On a one min chart an up crossover that is below the zero line may mean that the market may be turning up ( risky entry ) or that it is just pausing for breath before continuing down, therefore a down crossover that is below the the zero line implies that the trend is contiuning ( low risk entry ).

Additionally filtering by looking at where the the signal lines and MACD sit on the 3 min chart will clarify the correct entry.

Take a look at stockcharts education which covers the MACD basics in good detail.

http://www.stockcharts.com/education/IndicatorAnalysis/indic_MACD1.html

U.S. open is at 2.30 p.m. GMT, HTH = Hope That Helps

Let me know if you need anymore info
 
Excellent link. Very useful and comprehensive. Should be able to use this to improve on my (very) basic system.

Thanks
 
Additionally filtering by looking at where the the signal lines and MACD sit on the 3 min chart will clarify the correct entry.

Could you please elaborate on this Shark ?
 
Top