Hull Moving Average / EMA Crossover Trend Indicator


This post was contributed by a guest author, and does not necessarily reflect the views of Richard or MovetheMarkets.com


I’ve played with EMA crossover systems in the past, such as a 5EMA / 20EMA cross to determine trend direction. There’s a ton of whipsaws in a system like that, so I gave up on it.

I’ve been experimenting with Hull Moving Averages since TraderD first introduced them to us.

What’s a Hull Moving Average?

TraderD tells us:

The HMA employs weighted moving averages and dampens the smoothing effect (and resulting lag) by using the square root of the period instead of the actual period itself:

waverage(2*waverage(close,period/2)-waverage(close,period), SquareRoot(Period)

See:

http://www.justdata.com.au/Journals/AlanHull/hull_ma.htm

Basically, it’s a weighted moving average that reacts more quickly to recent price than a typical weighted MA. I thought that if I used a Hull MA (HMA), I could get a better MA crossover system. When you have EMA’s of different periods, there’s not much difference between the two unless the time intervals are large, like a 5/20. Then the 20 EMA is way too damped compared to the 5 period. Plus, the effect of data dropping off the end of the period affects each one differently and at different times. Rather than having 2 EMA’s of different periods for my crossover, I decided to take an EMA as the measure of past direction and an HMA as the measure of current direction. Then the phasing and drop-off effects are better matched.

How I use the Hull Moving Average

I use the 5-EMA a lot in my trading, as I find that it provides a good sense of whether price is extended in the short term. Price will move away from it, and retrace to it, but if the EMA is trending and a candle doesn’t close across it, I find that the trends remain intact:

spy-candle-5d_15m-2007-07-12-133530.GIF

If I add a 5-HMA to the chart, this is what happens:

spy-candle-5d_15m-2007-07-12-133618.GIF

Both of these MA’s are being calculated by (H/L)/2 as Richard has recently commented on. You can see the the blue HMA reacts very quickly to changes in price, even overshooting on big moves. When there is a strong uptrend, the HMA is consistently above the EMA, and vice-versa for strong downtrends. In a sideways market, like Monday 7/9, there are a lot of false signals as the HMA crosses back and forth. I’m still working on a good way to determine when a crossover will lead to a trend and when it’s just noise.

The Paintbar

I added simple paintbars that refer to when the crossover takes place, as shown below:

spy-candle-5d_15m-2007-07-12-134100.GIF

The code for the crossover is straightforward–if HMA>EMA and HMA[1]<EMA[1] then set color to green, opposite for red.
Then an arrow shape above or below the candle where it takes place.

I added a general trend paintbar, where the crossover isn’t important. If the HMA is above the EMA, we’re in an uptrend and the color is green, if it’s below the color is red, and set it as a band at the bottom of the chart:

spy-candle-5d_15m-2007-07-12-134325.GIF

Rather than have the MA’s crossing all over the chart, I can just look at the paintbar to tell me if the trend is up or down:

spy-candle-5d_15m-2007-07-12-134608.GIF

I add this paintbar to all of my charts, and it’s on the one of my trade today (where I ignored it to my peril).

That’s it! If anybody has ideas of better ways to reduce false trend change signals with this, I’m all ears.


This post was contributed by a guest author, and does not necessarily reflect the views of Richard or MovetheMarkets.com


3 Responses

  1. Richard Says:

    I haven’t read this closely yet, but after skimming it I wanted to point out that values never “fall off” an EMA like they do with SMAs or stochastics etc.

  2. Prospectus Says:

    DOH! You’re right–that doesn’t apply to EMA’s. It does apply to HMA’s though, as I understand it.

  3. Alan Says:

    Prospectus-

    Thanks for the explanation. I love QT’s paintbars and I’m always looking for good ideas.

    Alan

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.