Profitable EA - so far; 60days = 562 pips

 

Hello,

I am just learning MetaQuotes so it is slow going.

I have started writing an EA that can enter a trade when I want.

I enter the trade with a stop loss of 50 and a take profit of 15.

I tested the EA on the Neuimex platform for the dates 12/1/06 thru 2/5/07 with a profit of 562 pips. I will try to include a screen print of the results.

Basically my EA takes the first tick of a 15 min and a 4hr chart. If the previous 15m close is above 50% of the chart and the 4hr close is above 75% then I buy. Below 50% and 75% I sell.

Now I want to add some things to it. I want to be able to move the stop to break even once I am up 10 pips and also have a trailing stop of 10 pips.

Also I believe there is a way to know buying and selling pressure. If possible I would like to only enter the trade if the pressure is in the direction of the trade I want to take.

I would like to learn how to do this but I am not opposed to someone doing it for me. I can learn by reading the finished code.

This is what I got so far.....

if(Volume[0]>1) return;

int ticket;

double dCurrentOpen, dCurrentHigh;

double dCurrentLow, dCurrentClose;

double dA, dD;

double dCD, dPerc;

double dCurrent4hrOpen, dCurrent4hrHigh;

double dCurrent4hrLow, dCurrent4hrClose;

double dA4, dD4;

double dCD4, dPerc4;

dCurrent4hrOpen=iOpen("EURUSD",PERIOD_H4,1);

dCurrent4hrHigh=iHigh("EURUSD",PERIOD_H4,1);

dCurrent4hrLow=iLow("EURUSD",PERIOD_H4,1);

dCurrent4hrClose=iClose("EURUSD",PERIOD_H4,1);

dA4=(dCurrent4hrHigh+dCurrent4hrLow)/2;

dD4=dCurrent4hrHigh-dA4;

dCD4=dCurrent4hrClose-dA4;

dPerc4=dCD4/dD4;

dCurrentOpen=iOpen("EURUSD",PERIOD_M15,1);

dCurrentHigh=iHigh("EURUSD",PERIOD_M15,1);

dCurrentLow=iLow("EURUSD",PERIOD_M15,1);

dCurrentClose=iClose("EURUSD",PERIOD_M15,1);

dA=(dCurrentHigh+dCurrentLow)/2;

dD=dCurrentHigh-dA;

dCD=dCurrentClose-dA;

dPerc=dCD/dD;

if (dPerc > 0.4999 && dPerc4 > 0.7499)//0.499)

{

double ask=MarketInfo("EURUSD",MODE_ASK);

double dSL=ask-0.0050;

double dTP=ask+0.0015;

ticket=OrderSend("EURUSD",OP_BUY,1.0,Ask,3,dSL,dTP,"BUY Order",255,0,CLR_NONE);

}

if (dPerc < -0.4999 && dPerc4 < -0.7499)//0.4999)

{

double bid=MarketInfo("EURUSD",MODE_BID);

double dSLB=bid+0.0050;

double dTPB=bid-0.0015;

ticket=OrderSend("EURUSD",OP_SELL,1.0,Bid,3,dSLB,dTPB,"SELL Order",255,0,CLR_NONE);

}

Thanks for any help.

Mike

Files:
 

I took the liberty of cleaning up the code that you provided. The EA still works the same, but better. Now it'll work with any symbol, not just EURUSD. And you can define the parameters (lots, stoploss, takeprofit) from the options windows.

Files:
 

Thanks for cleaning it up, it was my first attempt at an EA and my only concern was to get it to work.

What are your thoughts on the profitablity of this EA?

Is 500+ pips over a 2 month period a good return for an EA?

I am hoping that the changes I want to make will increase the percentage of winning trades. I also want to see if I can lower the initial stop loss and remain profitable.

 

I took some more liberties and added the breakeven and made it take only one order at a time. Keep us updated on your progress with this system.

Files:
 

Hi,

I just want know how to use this file to my chart? Im also using Metatrader4 and after compiling this file what next?

pls need your help tks

jasper

 

What is option value"BreakEvenShift" used for? Does it have anything to do with trailing stop.

Rich

 

Any indicators needed with this is it for any specific pair?

 

Tested it on demo for 24 hours now made 1 trade $150 winner only had it on euro but now ill try it on all 4 main pairs.

 

What Time Frame do you run this EA on ?

Would like to test it.

Thanks

 
jasperdant:
Hi, I just want know how to use this file to my chart? Im also using Metatrader4 and after compiling this file what next? pls need your help tks jasper

I think it is a secret

 
jasperdant:
Hi, I just want know how to use this file to my chart? Im also using Metatrader4 and after compiling this file what next? pls need your help tks jasper

It's no secret, it's just that nobody feels like answering it because it is so basic. Check out the MT4 site for some info.

Forex Trading Platform MetaTrader 4

Reason: