Explore the New HAS EA for MetaTrader 4 - Your Trading Companion

Mike 2010.05.18 17:47 52 0 0
Attachments

Hey there, fellow traders!

Today, I’m excited to share a new EA (Expert Advisor) that I’ve been working on. It’s currently in the ‘play with’ stage, and I thought it’d be fun to open it up for everyone to test out!

How It Works

All the magic happens right here:

// PLACE ORDER
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;
BUY_FX(NULL);
}

//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;
SELL_FX(NULL);
}
//SELL_FX(NULL);
//BUY_FX(NULL);
}

I've set up some variables for you to play around with.

Below are the active time counts for the HAS indicator in ticks. The ‘U’ stands for UP, and ‘D’ for down.

In the chart, the two swap based on whether 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 following variables are the standard ones:

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

The next set indicates whether the indicator is currently up or down. A value of 0 means down, and 1 means up.

For example, m1=0 indicates that the HAS indicator on the M1 chart is down or RED.

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

This EA offers a lot of flexibility for your trading strategy!

Here’s what this line means:

Ignore the m1 HAS chart, the 5m tick 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)

To use this EA, you’ll need the HAS indicator saved under your indicators folder.

You can run this on any time frame since it considers all of them.

Any feedback, questions, or just some friendly chat would be awesome! Let’s get trading! :)


List
Comments 0