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,d TPB,"SELL Order",255,0,CLR_NONE);
}
Thanks for any help.
Mike