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:
PHP Code:
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 < -0.00040 && adx > 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