Hull Moving Average EA

 

hi there.

first post.

i am after an expert advisor for MT4.

It buys and sells with the triggers of Hulls Moving Averages.

Does anyone have one, can point me to one, or build me one, please?

Bradman

 

Could you attach the moving average indicator please?

 

Have a great day

Files:
 

This is the indicator:

//+------------------------------------------------------------------+

//| HMA.mq4

//| Copyright © 2006 WizardSerg , ?? ??????? ForexMagazine #104

//| wizardserg@mail.ru

//| Revised by IgorAD,igorad2003@yahoo.co.uk |

//| https://www.mql5.com/en/forum |

//+------------------------------------------------------------------+

#property copyright "MT4 release WizardSerg , ?? ??????? ForexMagazine #104"

#property link "wizardserg@mail.ru"

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Aqua

#property indicator_color2 Tomato

//---- input parameters

extern int period=21;

//extern int method=0; // MODE_SMA

extern int method=3; // MODE_SMA

extern int price=0; // PRICE_CLOSE

extern string Sound_File="alert2.wav";

//---- buffers

double Uptrend[];

double Dntrend[];

double ExtMapBuffer[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

IndicatorBuffers(3);

SetIndexBuffer(0, Uptrend);

//ArraySetAsSeries(Uptrend, true);

SetIndexBuffer(1, Dntrend);

//ArraySetAsSeries(Dntrend, true);

SetIndexBuffer(2, ExtMapBuffer);

ArraySetAsSeries(ExtMapBuffer, true);

SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);

SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);

IndicatorShortName("Hull Moving Average("+period+")");

return(0);

}

//+------------------------------------------------------------------+

//| Custor indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

// ???? ????? ?????? ??????

return(0);

}

//+------------------------------------------------------------------+

//| ?????????? ??????? |

//+------------------------------------------------------------------+

double WMA(int x, int p)

{

return(iMA(NULL, 0, p, 0, method, price, x));

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

int counted_bars = IndicatorCounted();

if(counted_bars < 0)

return(-1);

int x = 0;

int p = MathSqrt(period);

int e = Bars - counted_bars + period + 1;

double vect[], trend[];

if(e > Bars)

e = Bars;

ArrayResize(vect, e);

ArraySetAsSeries(vect, true);

ArrayResize(trend, e);

ArraySetAsSeries(trend, true);

for(x = 0; x < e; x++)

{

vect[x] = 2*WMA(x, period/2) - WMA(x, period);

// Print("Bar date/time: ", TimeToStr(Time[x]), " close: ", Close[x], " vect[", x, "] = ", vect[x], " 2*WMA(p/2) = ", 2*WMA(x, period/2), " WMA(p) = ", WMA(x, period));

}

for(x = 0; x < e-period; x++)

ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x);

for(x = e-period; x >= 0; x--)

{

trend[x] = trend[x+1];

if (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1;

if (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1;

if (trend[x]>0)

{ Uptrend[x] = ExtMapBuffer[x];

if (trend[x+1]<0) {

Uptrend[x+1]=ExtMapBuffer[x+1];

//PlaySound(Sound_File);

}

Dntrend[x] = EMPTY_VALUE;

}

else

if (trend[x]<0)

{

Dntrend[x] = ExtMapBuffer[x];

if (trend[x+1]>0) {

Dntrend[x+1]=ExtMapBuffer[x+1];

//PlaySound(Sound_File);

}

Uptrend[x] = EMPTY_VALUE;

}

//Print( " trend=",trend[x]);

}

return(0);

}

//+------------------------------------------------------------------+

 

i have a seperate program: e-trailing

with a magic number on the Hull moving average EA i can place SL,TP, breakevens, and trailing stop losses using an identical chart of the same currency. Though maybe magic numbers are just if you want to use the same EA but on a different timeframe.

This is a great!!!!! indicator, and the EA off it will be great.

 

bradman, so what's your system? how to enter and exit? I'll code one for you.

coin.inv, i don't think a script would do the trailing stop thing, and how to enter and exit?

 

Thanks Scorpion,

just PMed the SL, TP etc to you. I use the e-trailing EA so it doesn't need to be built in.

Enter and exit when the colour indicator changes.

I gave a long winded version of what i am doing in the PM.

 

I modified HMA and added an alert on color change showing buy and sell.

Files:
 

Okay, i figured out how you people attach these files.

This is the indicator i copied and pasted above.

-------

i will do away with trailing stop losses, as they will trigger too much.

visually checking data i see about 200 pips "per major" per month.

I hope others see potential with Hull moving averages.

I was going to try to turn $1k into $1.2 million in ten months with this.

2 Lots per $10k - 0.2 lots for $1k

but that is risky. Even though it is great at eating trend pips.

Do people think i could get a realistic 50% a month?

that would be 1 Lot per $10k (4 trades simultaneous over majors).

I would have to lose 1000 pips for a wipeout.

1500

2250

3375

5062.50

7593.75

11,390

17,085

25,628

38,443

57,665

86,497

129,746

194,619

291,927

437,893

656,840

985,261 17 months!!

Long live the scorpion Hull EA!!!!!!!!

Files:
 

Have a great day

 
bradman:
Okay, i figured out how you people attach these files. This is the indicator i copied and pasted above. -------i have found what i think is the ideal setting: 3/32 i will do away with trailing stop losses, as they will trigger too much.visually checking data i see about 200 pips per major per month. Scorpion, i am wondering how long these take to program. I assume it consumes several hours.I would like to start trading live in November, assuming i get paid $1k i am owed.maybe a week or two on demo first to make sure EA works.I hope others see potential with Hull moving averages. I was going to try to turn $1k into $1.2 million in ten months with this.2 Lots per $10k - 0.2 lots for $1k but that is risky. Even though it is great at eating trend pips. Do people think i could get a realistic 50% a month?that would be 1 Lot per $10k (4 trades simultaneous over majors).I would have to lose 1000 pips for a wipeout. 1500225033755062.507593.7511,39017,08525,62838,44357,66586,497129,746194,619291,927437,893656,840985,261 17 months!! Long live the scorpion Hull EA!!!!!!!!

here ya go

Files:
one_million.doc  654 kb