Download MetaTrader 5

OrderClose problem and how to check closed order

To add comments, please log in or register
Do you have a trading signal? Publish it in your blog as well!
forexistence
285
forexistence 2010.08.04 00:21 

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??

Andrei Moraru
1157
Andrei Moraru 2010.08.04 11:11  

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.

forexistence
285
forexistence 2010.08.04 16:07  
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
Andrei Moraru
1157
Andrei Moraru 2010.08.04 20:21  

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

Wackena
648
Wackena 2010.08.04 20:27  
To add comments, please log in or register