Getting deals from a specific pending request (order)!

 

Hello guys!

I hope you are fine!

My system sends a lot of pending orders by minute. To EA's internal control, I need to get all deals (trades) from a specific pending order during its life.

I tried to control it using the function OnTradeTransaction in EA, informing each deal for its specific pending order control. But, sometimes, I don't receive the trans.type == TRADE_TRANSACTION_DEAL_ADD of some deals. I don't know why. And my control fails.

So, I'm trying to control it with another native function of MQL5, like "HistoryOrders...". But I didn't find a function to get all deals from a specific order quickly... Only getting all deals in a time window and cheking if each order has the same id of the pending request.

Is there a qick function for it?

Best regards!

 
humbertobrandao:

Hello guys!

I hope you are fine!

My system sends a lot of pending orders by minute. To EA's internal control, I need to get all deals (trades) from a specific pending order during its life.

I tried to control it using the function OnTradeTransaction in EA, informing each deal for its specific pending order control. But, sometimes, I don't receive the trans.type == TRADE_TRANSACTION_DEAL_ADD of some deals. I don't know why. And my control fails.

Maybe this is your problem ?

Transactions queue length comprises 1024 elements. If OnTradeTransaction handles a new transaction for too long, the old ones in the queue may be superseded by the newer ones.


So, I'm trying to control it with another native function of MQL5, like "HistoryOrders...". But I didn't find a function to get all deals from a specific order quickly... Only getting all deals in a time window and cheking if each order has the same id of the pending request.

Is there a qick function for it?

No quick function. Is this a problem ?
 
angevoyageur:

No quick function. Is this a problem ?

Unfortunately, yes. This is a big problem for me because every minute, I send hundreds of pending order.

Very inefficient to check this, because, every time, I need to loop doing this comparison, checking a lot of deals that I'm not interested in them. I was looking for a function more efficient.

In this context, I'm using my processing a lot. And I have the same EA running in 70 different symbols. This is my main problem right now. 

 
humbertobrandao:

Unfortunately, yes. This is a big problem for me because every minute, I send hundreds of pending order.

Very inefficient to check this, because, every time, I need to loop doing this comparison, checking a lot of deals that I'm not interested in them. I was looking for a function more efficient.

In this context, I'm using my processing a lot. And I have the same EA running in 70 different symbols. This is my main problem right now. 

You have to code it efficiently.