A simple setup - EA requested for testing

 

I don't know anything about programming an EA. If anyone can please help me?

MA1 - 24 Exp high

MA2 - 24 Exp low

Macd - default

adx - default

buy

1. price above MA1

2. macd above +0.00040

3. adx above 22

exit - price below MA2

- macd below 0

sell - 1. price below MA2

2. macd below -0.00040

3. adx above 22

exit - price above MA1

macd above 0

tp = 200

stoploss = 25

trailing sl = 5

TF = 1hr

option to change tp, sl functions.

 

Hi,

Has your system been test manually? Are you wanting to open the order on the first instance of the price moving past the MA or do you want to open on Open of the first bar past the MA?

 

can you post a chart, please?

 

hi,

I tested it manually for a couple of trades and it works fine, only thing is this method needs to be tested more vigirously with maybe one more condition to eliminate whipsaws.

The Macd establishes a good trend direction.

The adx signals the strength of the established trend but i found that the Pairs with Euro as base and GBP as base is not that good because of too much whipsaws, maybe another indicator which can eliminate such whipsaws can be used but that can be added later once we have a basic EA to work on.

Hi, Nicholishen , I think , the next bar after the condition are met would be safer.

thxs

Files:
chart_1.jpg  107 kb
 

Here is the EA which you have requested. Testing is not as good as i had hoped, but you can play around with it a bit. Here is the code for entry and exit:

int TradeSignal(int functyp){

int x=Confirm;

double

MA1=iMA(NULL,0,24,0,MODE_EMA,PRICE_HIGH,x),

MA2=iMA(NULL,0,24,0,MODE_EMA,PRICE_LOW,x),

MACD=iMACD(NULL,0,12,26,9,MODE_CLOSE,MODE_SIGNAL,x),

adx=iADX(NULL,0,14,MODE_CLOSE,0,x);

/*

MA1 - 24 Exp high

MA2 - 24 Exp low

Macd - default

adx - default

*/

if(functyp==1){//open

if(Ask > MA1 && MACD > 0.00040 && adx > 22)return(2);

if(Bid < MA2 && MACD 22)return(1);

}

if(functyp==2){//exit

if(Bid<MA2 && MACD < 0 )return(0);

if(Ask>MA1 && MACD > 0)return(0);

}

/*

buy

1. price above MA1

2. macd above +0.00040

3. adx above 22

exit - price below MA2

- macd below 0

sell - 1. price below MA2

2. macd below -0.00040

3. adx above 22

exit - price above MA1

macd above 0

tp = 200

stoploss = 25

trailing sl = 5

TF = 1hr

*/ return(0);

}

Nic

Files:
 

hi,

thankyou Nicholishen for the EA ,

I would like to post this EA on a different thread so that others can contribute or critise .

I used daily chart backtest , looks very promising, look at the thread titled "NEW EA courtesy of Nicholishen".

Mohammed also gave me a good EA.

You guys are great.

Reason: