onTradeTransaction not triggered

Alon D
63
Alon D  

Calling positionClose from the CTrade class doesn't trigger the onTradeTransaction  event.

Is there a different way I should close a position?

Vladimir Karputov
Moderator
220712
Vladimir Karputov  
Alon D :

Calling positionClose from the CTrade class doesn't trigger the  onTradeTransaction   event.

Is there a different way I should close a position?

There are two reasons: 1. The position was not closed (for example, a requote was received) 2. You do not know how to handle OnTradeTransaction.

amrali
3423
amrali  

Try to use my TradeTransaction class


https://www.mql5.com/en/code/24901

TradeTransaction Class
TradeTransaction Class
  • www.mql5.com
When performing some definite actions on a trade account, its state changes. Such actions include: Sending a trade request from any MQL5 application in the client terminal using OrderSend and OrderSendAsync functions and its further execution; Sending a trade request via the terminal graphical interface and its further execution; activation of...