OnTradeTransaction: Is deal being closed?

 

I'm using OnTradeTransaction() to monitor trades.  

Is there a way to tell if the deal is being opened or closed?

Right now I'm filtering the callbacks using trans.type == TRADE_TRANSACTION_DEAL_ADD

Thanks.
 
Charles Stangor:

I'm using OnTradeTransaction() to monitor trades.  

Is there a way to tell if the deal is being opened or closed?

Right now I'm filtering the callbacks using trans.type == TRADE_TRANSACTION_DEAL_ADD

Thanks.

A deal is never "closed". I suppose you mean a deal which result in opening or closing of a position ?

You have to use :

HistoryDealGetInteger(ticket,DEAL_ENTRY);
 
Alain Verleyen:

A deal is never "closed". I suppose you mean a deal which result in opening or closing of a position ?

You have to use :


Sorry, so this is a puzzle to me.  What is a "deal?" -- is it the same as an executed order (a trade)?

thanks.

 
futures_track:


Sorry, so this is a puzzle to me.  What is a "deal?" -- is it the same as an executed order (a trade)?

thanks.

No it's not.

See this article https://www.mql5.com/en/articles/211

Orders, Positions and Deals in MetaTrader 5
Orders, Positions and Deals in MetaTrader 5
  • 2011.02.01
  • MetaQuotes Software Corp.
  • www.mql5.com
Creating a robust trading robot cannot be done without an understanding of the mechanisms of the MetaTrader 5 trading system. The client terminal receives the information about the positions, orders, and deals from the trading server. To handle this data properly using the MQL5, it's necessary to have a good understanding of the interaction between the MQL5-program and the client terminal.
 
Alain Verleyen:

No it's not.

See this article https://www.mql5.com/en/articles/211


OK, so that's helpful Alain. ty
 
Alain Verleyen:

A deal is never "closed". I suppose you mean a deal which result in opening or closing of a position ?

You have to use :


ty
Reason: