You are just attempting to close a second time if the first one fails. The second close could also fail, so you are left with open trades.
You need to retry a few more times in a loop with a Sleep in between, and exit if retried for more than say 5 times without succeeding.
What is your slippage? You might need to increase it if too small.
You are just attempting to close a second time if the first one fails. The second close could also fail, so you are left with open trades.
You need to retry a few more times in a loop with a Sleep in between, and exit if retried for more than say 5 times without succeeding.
What is your slippage? You might need to increase it if too small.
Thanks Blog for answers.
I will look for the "big closin loop" trail.
slippage is 2+spread (so it is for currencies traded between 4 and 20). I will try that too, but i don't have errors related to slippage in journal.
But i don't have any error in my expert journal, so i hardly believe this is this cases. See the "close at deinit" print at the second retry. I don't see that in journal. Some trades are closed, others aren't.
Very strange.... I have seen in mql manual that deinit should not loop long. Is there a limit (2.5s?).
i use attached script whenever hit panic button or want close everything - is shotgun approach. (i gave name so is top of navigators script name list - so always 'know' where to get too fast! :)
maybe look at code and give ideas...
Best
4got mention: must ALWAYS loop high --> low when using orderstotal + orderclose
look on forum - much info as why must do. i got comment in attachated file of last post - explain why...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This simply does'nt work. My EA opens lot of trades, and i just want when i close EA that EA closes all his trades. I think it doesn't work because deinit is fast, faster that time required to close all trades.
In case of bugs can someone see code below? I insert CloseFunction in deinit function. Only one or two orders are close, but the others always opened.....
Thanks for advance,
Dam.