
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
and this script only close 1 position and we must attached it to same chart,
i was thinking it close all positions we have ; based on :
this was my Towards Understanding.
thank you all.
and this script only close 1 position and we must attached it to same chart,
i was thinking it close all positions we have ; based on :
this was my Towards Understanding.
<Link removed by moderator>
thank you all.
Yes the script close position of the current symbol only.
I removed the link as it's not allowed the post link to Market products on the forum (even free). Why not use this product if you need to close all position ?
Yes the script close position of the current symbol only.
I removed the link as it's not allowed the post link to Market products on the forum (even free). Why not use this product if you need to close all position ?
ok, and sorry,
i edit it again,
new build of mt5 have the solution
just for close all position .
thank you.
ok, and sorry,
i edit it again,
new build of mt5 have the solution
just for close all position .
thank you.
Sorry but I miss something, which solution ?
i was thinking may be the older build of metatrader 5 does not have this.
----
Yes the script close position of the current symbol only.
I removed the link as it's not allowed the post link to Market products on the forum (even free). Why not use this product if you need to close all position ?
just for close all position at same time.
thank you.
i was thinking may be the older build of metatrader 5 does not have this.
The script stopped working properly. Instead of closing positions, it opens them. ((
The script stopped working properly. Instead of closing positions, it opens them. ((
In principle, the script is made for brokers who have only one position for each currency. Because it is not clear what, in fact, to close, when the object for applying efforts is not one, but in plural.
So the problem with opening is closed, the new code will be published, but with a lot of positions it will still be incorrect.
It's kind of self-explanatory
#include <MT4Orders.mqh> // https://www.mql5.com/en/code/16006
#define Bid (SymbolInfoDouble(_Symbol, SYMBOL_BID))
#define Ask (SymbolInfoDouble(_Symbol, SYMBOL_ASK))
void OnStart()
{
for (int i = OrdersTotal() - 1; i >= 0; i--)
if (OrderSelect(i, SELECT_BY_POS) && (OrderSymbol() == _Symbol) && (OrderType() <= OP_SELL))
OrderClose(OrderTicket(), OrderLots(), (OrderType() == OP_BUY) ? Bid : Ask, Deviation);
}
Hardly! Your code is like a rhinoceros in a china shop, it will just smash all positions and that's all, not close the required volume. Good luck.