MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

Buy Latest Technical Indicators in MetaTrader Market
To post a new code, please log in or register

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2010.05.18 08:47

HAS EA NEW - expert for MetaTrader 4

| English Spanish Portuguese


Hi there.

This is a EA that I'm working on. It's in the "play with" stage now and I though I would make it open for everybody to play with.

How this works.

Al the changes takes place here:

if (OrdersTotal() < 1)
//if (m1==1&&m5==0&&m15==1&&m30==1&&h1==1&&h4==1)
if (/*m1==1&&*/cm5U<10&&m5==1&&cm15U>200&&m15==1&&m30==1&&h1==1&&h4==1)
if (fail) StopLoss=StopLoss+5;

//if (m1==0&&m5==1&&m15==0&&m30==0&&h1==0&&)//h4==0)
if (/*m1==0&&*/cm5D<10&&m5==0&&cm15D>200&&m15==0&&m30==0&&h1==0&&h4==0)
if (fail) StopLoss=StopLoss+5;

I have avaiables to play with.

The ones below are the ammount of time a HAS indicator is active in ticks. The U is for UP and D is for down.

In the chart the 2 swap depending on if the HAS indicator is up or down (RED/GREEN)

int cm1U,cm5U,cm15U,cm30U,ch1U,ch4U=0;
int cm1D,cm5D,cm15D,cm30D,ch1D,ch4D=0;

The variables below are the normal ones.

extern int TakeProfit=20;
extern int StopLoss=500;
extern int Magic=12367;
extern double LOT = 0.1;

The ones below are the actual up/down of the indicator. 0=down, 1=up.

ie.. m1=0 means the HAS indicator on the M1 chart is down or RED.

int m1,m5,m15,m30,h1,h4;

With this you can play and have a lot of settings.

The below means:

Ignore the m1 HAS chart, The 5m tic counter must be below 10, The 15m Tick counter must be below 200, and the rest (30m to 4h) must be up(1).

if (/*m1==1&&*/cm5U<10&&m5==1&&cm15U>200&&m15==1&&m30==1&&h1==1&&h4==1)

You need the HAS indicator for this. Save it under indicators.

You can run this on any time frame as it looks at all the time frames.

Any news or help or just nice info would be very nice. :)

Last comments | Go to discussion (3)
MQL4 Comments
mql4_comments | 20 May 2010 at 04:58

Interesting concept, looking forward to seeing all of it :)

FXIA | 21 May 2010 at 04:13
Jaco, I can't get your profile page up to send a PM. I have something for this EA that could improve it or start to make it into a different version than it is with a simple addition for entry. I have most of the code necessary as well. Please send me a PM and I will write back when I can.
wolf1210 | 31 Dec 2011 at 13:30

Interesting concept, looking forward to seeing all of it :)


I would suggest that you add a filter for the sideways flat market to improve it and get rid of whipsaws!

Regards Wolf1210