Download MetaTrader 5

Closing deal type Order?

To add comments, please log in or register
SteelAce
201
SteelAce  
I succeeded to open TRADE_ACTION_DEAL type OrderSend(). It indeed opens order in "Trade" Tab. I want it working few minutes and close it after that with program. Problem is that I can close it only manually. It is so tricky that even OrdersTotal() cannot see that. Is it somehow possible to close it with Mql5?
Stanislav Korotky
20303
Stanislav Korotky  
Just create another order in opposite direction with the same lot.
Enrico Lambino
5529
Enrico Lambino  
If you are going to use the standard library, you can use PositionClose. But this is assuming that you would like to rid a given currency pair of all active positions (it will close all).
Alain Verleyen
Moderator
32394
Alain Verleyen  
Iceron:
If you are going to use the standard library, you can use PositionClose. But this is assuming that you would like to rid a given currency pair of all active positions (it will close all).
It can only exist 1 position for a given currency pair.
To add comments, please log in or register