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
I have a bigger problem now, my broker tends to partially execute orders.
Dear Customer,
Please be hereby advised that your trade has been opened partially (2.32 lots out of 15.84) at the price 587.318.
Should you have any additional questions on this issue, don’t hesitate to contact us.
Kind Regards,
Broker.
here is what support say:
Please be advised, during periods of high volatility or low liquidity, Limit Orders may be partially executed. This means that the position will get filled immediately fully or partially if the price is met. In you case your order was executed partially, that is why you have received notification letter.
I understand how to close all orders despite them being closed partially, I just have to do Close all Orders while OrdersTotal() > 0, but I don't know what to yet when orders open partially.
edit:
Just realized that I have to check proper Symbol and magicnumber orders, it is a bit more difficult
edit: here is the close all orders function that should close orders even with partial closure
rewritten
rewritten
wow!
that's a little bit tricky for me, I have read through it like 4 or 5 times before I got it. Thanks!
and... what happens if OrderSelect returnes false?
How often does orderselect return false? Is it even possible?
wow!
that's a little bit tricky for me, I have read through it like 4 or 5 times before I got it. Thanks!
and... what happens if OrderSelect returnes false?
How often does orderselect return false? Is it even possible?
i= 0
comes back from loop
i = -1
if(OrderSelect(-1,SELECT_BY_POS,MODE_TRADES)==false) break; // ==> end checking trades we break the loop
next CloseOrder()
what commonerrors can be returned from GetLastError()
if closing fails it might next one is failing also for an error like tradecontext too busy or other error...
so what can you do avoiding a lot of this situations will happen ??
so what can you do avoiding a lot of this situations will happen ??
don't know yet. I've got to think it over.
I am stuck with another problem right now.
I have put my EA on a windows 2003 VPS and now it is returning "terminated by timeout" error, but I have never seen such a error on my home PC.
And the error pops up not the time my while close and open order cycles running, but when the expert jush checks for crossing and go idle.
I mean, the program checks for new bar opening, trailingstop = 0 so no trailing stop function call, then if new bar opened it checks EMA cross, there is no cross (the times I got timeout errors the EMA lines were far from crossing), so the program returnes(0)
There is no cycles! How can it be terminated by timeout?
don't know yet. I've got to think it over.
I am stuck with another problem right now.
I have put my EA on a windows 2003 VPS and now it is returning "terminated by timeout" error, but I have never seen such a error on my home PC.
And the error pops up not the time my while close and open order cycles running, but when the expert jush checks for crossing and go idle.
I mean, the program checks for new bar opening, trailingstop = 0 so no trailing stop function call, then if new bar opened it checks EMA cross, there is no cross (the times I got timeout errors the EMA lines were far from crossing), so the program returnes(0)
There is no cycles! How can it be terminated by timeout?
this is not a cycle ??
this is not a cycle ??
I mean during the time when the EA was terminated EMA lines were far from crossing so a NewOrder function wasn't called, so the cycle you are talking about (which is inside the NewOrder function) wasn't run.
added IsStopped condition