The Hull Moving Average (HMA), developed by Alan Hull, is an extremely fast and smooth moving average. In fact, the HMA almost eliminates lag altogether and manages to improve smoothing at the same time. The Hull Moving Average solves the dilemma of making a moving average more responsive to current price activity whilst maintaining curve smoothness.
I prefer it over most of the other MAs method and after a chat with a friend programmer/trader (CJA) I decided to apply “common” indicators to the hull moving average to have smoothed curves and much clear signals (hoping in less false signals).
Below You’ll find the link to download a set of HullMA based indicators. I hope you’ll like them as much as I’m starting to love them.
To install them simply copy the “HullMA.mq4” indicator in the “MT4\experts\indicators” folder, along with the other “HMA_” version of the new indicators.
Make sure you don’t rename the HullMA.mq4 file as it is used by all the others to calculate the hull moving average of price.
Attached is the code of the indicators so those interested in programming MQL4 can read them and understand how this things works and develop their own “HMA version” of preferrend indicators. It is very simple.
For the RSI for example… I took the original code of the RSI and substituted all the calls to the price with a call to the HMA of the price. How?
Using the “iCustom” function. It’s one of the best function available to MQL4 programmers. It lets you “call” an external indicator, and have back its value at a specific bar. So insted of giving to the RSI the “Close” of the price I gave to it the value of the HMA indicator of the close of the price for the same bar.
So, for example:
rel= Close[k] – Close[k+1];
rel= iCustom(NULL,0,”HullMA”,HMA_period,HMA_price,HMA_m ode,0,k) – iCustom(NULL,0,”HullMA”,HMA_period,HMA_price,HMA_m ode,0,k+1);
and that is done every time the indicators uses price data (close, high, low, etc).
For each HMA indicator there are 3 additional options related to HMA:
HMA_period (default 12) – this is the period od the HMA used to calculate the indicator. The longer the smoother but the lag increases also.
HMA_price (default 0) – this is to what we want apply the HMA:
- PRICE_CLOSE 0 – Close price.
- PRICE_OPEN 1 – Open price.
- PRICE_HIGH 2 – High price.
- PRICE_LOW 3 – Low price.
- PRICE_MEDIAN 4 – Median price, (high+low)/2.
- PRICE_TYPICAL 5 – Typical price, (high+low+close)/3.
- PRICE_WEIGHTED 6 – Weighted close price, (high+low+close+close)/4.
HMA_mode (default 3) – this is the MA method used by the HMA to smooth:
- MODE_SMA 0 – Simple moving average,
- MODE_EMA 1 – Exponential moving average,
- MODE_SMMA 2 – Smoothed moving average,
- MODE_LWMA 3 – Linear weighted moving average.
I suggest you to leave this to default (3 – LWMA).ù
Here’s the list of indicators I re-coded using the HullMA:
- Bollinger Bands
- Price Speed And Acceleration
- Williams %R
Below are a few screeshots showing some of the indicators in action.
In my opinion, results are interesting for most of the indicators. Now I wait for you feedback.
[note class=”download”]To download them click here:
- Save it and unzip it.
- Copy all the “mq4″ files into your MT4/experts/indicators folder.
- Restart MT4 and you should see them all listed under “Custom Indicators” in the Navigator window.[/note]