Download MetaTrader 5

Difference between TRADE_ACTION_DEAL and TRADE_ACTION_CLOSE_BY for closing position?

To add comments, please log in or register
Frederic Metraux
509
Frederic Metraux  

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
10796
Nguyen Nga  

TRADE_ACTION_CLOSE_BY : Сlose a position by an opposite one

It used for account allow hedge.

Frederic Metraux
509
Frederic Metraux  
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