For my EA--PLZ HELP ME - Any Programmer !! - page 2

 
geevansubhiksha:

Hi here if you need a good ea contact me

Perhaps you missed this when you registered . . .

Look here: https://www.mql5.com/en/users/register

It says . . . "4. Posting of advertising messages is forbidden. "

 

One warning,  next time you will be BANNED. 

 

well, I got a bit of time on my hands tonight, and I owe this site a bit for helping me out on several occasios.

so, as I understand it, your EA get a signal to buy/sell, but it opens multiple trades instead of just one.

the problem is the market  never moves smoothly, one tick might cross your trigger line, opening up a trade.

but then the tick goes downagain, crossing that line again, opening another trade, ect. making multiple Trades.

 

    Now, there are several way's to avoid this, The way that was allready suggested was using a time stamp. eg.

TimeCurrent() = the current date, in seconds

so, now you have to decide how long you want your ea to wait before you allow it to look for another trade to make, (I recomend a min of 15 minutes unless you really want to piss off your broker) then convert that time into seconds (60 sec. per minute, x 15 = 900 seconds) And add that to the time stamp.

int TimeStamp= TimeCurrent() +900;

so now you add that time stamp right after your trade, and use a simple if statement to prevent it from making another trade till that time is up, eg:

int TimeStamp;
int Ticket;

int start()
{
// Your Code Here
if (TimeCurrent() > TimeStamp) // Check to see if enough time has passed to start making trades again.
{
   Ticket=OrderSend(Symbol(),OP_SELL,3,Bid,3,Ask+10000*Point,Ask-10000*Point); // make your trade
   TimeStamp=TimeCurrent()+900; // add your time stamp
}// end if
}// end start()

and thats one way to do it.

  However the way I do it is to simply only open one trade at a time (much esier since you don't have to keep track of multiple tickets)

and the way i do that is like the time stamp, you add a marker after the trade (eg, Marker = True) and when the order is closed, you remove the marker (Maker=False) and, once again, you would use an if statement to check if there is a marker in place or not.

hopefully that helps. cheers :) and happy programming.

and remeber, don't forget to use your head, and don't be afraid to use abscure and diffrent metholds to make your EA do what you want it to, and allways read up in the MQL4 book & dicuments :) cheers! 

 
nickblack:

Latest post of the person started this topic

 expertarts 2012.07.25 18:36           

 

The topic was closed until someone else was advertising his product

so i don't think your help did help 

Reason: