Download MetaTrader 5

[Deals] How to get only opened deals?

To add comments, please log in or register
Arturo Lopez Perez
164290
Arturo Lopez Perez  

Good morning,

I am having a hard time iterating deals from an EA. I would like to get only those deals which are currently open (several symbols, not related to one position).

Is there an easy way to do so? Iterating all deals does not seem efficient. Thanks in advance!

Alain Verleyen
Moderator
32007
Alain Verleyen  
PzTrading:

Good morning,

I am having a hard time iterating deals from an EA. I would like to get only those deals which are currently open (several symbols, not related to one position).

Is there an easy way to do so? Iterating all deals does not seem efficient. Thanks in advance!

A deal can be IN or OUT (eventually IN/OUT). A deal can't be "open" or "close", only a position can. So what are you trying to do exactly ?
Dua Yong Rew
5455
Dua Yong Rew  
PzTrading:

Good morning,

I am having a hard time iterating deals from an EA. I would like to get only those deals which are currently open (several symbols, not related to one position).

Is there an easy way to do so? Iterating all deals does not seem efficient. Thanks in advance!

HistoryDealGetInteger(Ticket, DEAL_ENTRY); > those that are sent
PositionGetInteger(POSITION_VOLUME); > currently opened
Arturo Lopez Perez
164290
Arturo Lopez Perez  
doshur:
Thanks!
To add comments, please log in or register