OrderClose problem and how to check closed order

 

Hi.

It's still very unclear to me how to manage the closing of the orders like in mql4.


I understand that on mt5 aren't more closed orders, but the order are "closed"

by opening an opposite position, but how to manage something like orderclose()

in the similar fashion to mql4? Can some programmers create a fake orderclose() similar

structure, in order to close the orders like the past?


And the most important thing:

how to find and check for closed orders??

 

There is PositionClose() method of the Trade class in Trade/Trade.mqh standard library.

To check the closed orders you have to check "deals" - see Trade/DealInfo.mqh.

 
enivid:

There is PositionClose() method of the Trade class in Trade/Trade.mqh standard library.

To check the closed orders you have to check "deals" - see Trade/DealInfo.mqh.

And about OrderClosePrice() ??


For OrderOpenPrice i use (i'm not sure if it is correct, i'haven't still tested it)

OrderGetDouble(ORDER_PRICE_OPEN)


but for OrderClosePrice i have no idea how to use PriceClose() methods and/or Trade classes

to look for (same thing for OrderCloseTime)


this is general for all closing-orders functions and old mq4 closing of the orders related things.


In other words i need help and more detailed informations and concrete examples.

Thanks in advance.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 

There is CDealInfo class in DealInfo.mqh. I has Time(), Price() and other useful methods that can tell everything you want.