Download MetaTrader 5

Difference between TRADE_ACTION_DEAL and TRADE_ACTION_CLOSE_BY for closing position?

To add comments, please log in or register
Articles have already helped many traders. Come and read them!
Frederic Metraux
512
Frederic Metraux 2016.06.15 23:26 

Hello,

All is in the title. If anyone can explain, when closing a position, the difference between TRADE_ACTION_DEAL and TRADE_ACTION_CLOSE_BY.

Apparently is it the same? In the Trade.mqh file, it is closing using TRADE_ACTION_DEAL. With my broker, in certain occasions, Trade.ClosePosition opened an opposite position. So I'm trying to change this with TRADE_ACTION_CLOSE_BY, but is is a wild guess.


So if anybody could put some light on this. What should I use? TRADE_ACTION_CLOSE_BY or TRADE_ACTION_DEAL?


Thanks.

Nguyen Nga
6516
Nguyen Nga 2016.06.16 09:26  

TRADE_ACTION_CLOSE_BY : Сlose a position by an opposite one

It used for account allow hedge.

Frederic Metraux
512
Frederic Metraux 2016.06.16 17:27  
Nguyen Nga:

TRADE_ACTION_CLOSE_BY : Сlose a position by an opposite one

It used for account allow hedge.

Thank you.
To add comments, please log in or register