You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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:
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!
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