Download MetaTrader 5

Closing deal type Order?

To add comments, please log in or register
Publish your programs in the Market. Make money with your knowledge!
SteelAce
180
SteelAce 2014.10.21 13:20 
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
17933
Stanislav Korotky 2014.10.21 13:36  
Just create another order in opposite direction with the same lot.
Enrico Lambino
4323
Enrico Lambino 2014.10.21 14:58  
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
30755
Alain Verleyen 2014.10.21 16:36  
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