DEAL_ENTRY_STATE

 

Hi everyone,


can someone explain me the purpose of this DEAL_ENTRY property: DEAL_ENTRY_STATE? The documentation gives no information about it, only the fact, that it exists.

What situations will involve using this?


Thanks,

    Benji

 
bvarga128:

Hi everyone,


can someone explain me the purpose of this DEAL_ENTRY property: DEAL_ENTRY_STATE? The documentation gives no information about it, only the fact, that it exists.

What situations will involve using this?


Thanks,

    Benji

Defines if the transaction is inbound or outbound market. 

If the open position is BUY, a trade can be IN (lot increases by a BUY order) or may be OUT (lot is decremented or the position is closed, according to the value of the volume specified in the pre-order execution trade: SELL order). 

If the position is SELL, IN implies SELL order, OUT implies BUY order.

//-------------------------------------  SALIDA DEL MERCADO  ------------------------------
bool esTransSalida(ulong ticket)
{           //salida o cierre de una posición
   bool resp= (HistoryDealGetInteger(ticket,DEAL_ENTRY)==DEAL_ENTRY_OUT);
   return(resp);
}

//-------------------------------------  ENTRADA AL MERCADO  ------------------------------
bool esTransEntrada(ulong ticket)
{
   bool resp= (HistoryDealGetInteger(ticket,DEAL_ENTRY)==DEAL_ENTRY_IN);
   return(resp);
}
 
josemiguel1812:

Defines if the transaction is inbound or outbound market. 

If the open position is BUY, a trade can be IN (lot increases by a BUY order) or may be OUT (lot is decremented or the position is closed, according to the value of the volume specified in the pre-order execution trade: SELL order). 

If the position is SELL, IN implies SELL order, OUT implies BUY order.

The question was about DEAL_ENTRY_STATE.
 

There is a related unanswered question (with a suggestion) -  https://www.mql5.com/en/forum/6036. I think may be MQ shed some light on this?

Forum on trading, automated trading systems and testing trading strategies

corresponding relation between DEAL_TYPE and DEAL_ENTRY

kwang1, 2012.01.29 17:04

Please advise if it's correct in following corresponding relation:


DEAL_TYPE  DEAL_ENTRY
1DEAL_TYPE_BUY/DEAL_TYPE_SELL DEAL_ENTRY_IN/DEAL_ENTRY_OUT/DEAL_ENTRY_INOUT
2DEAL_TYPE_BALANCE/DEAL_TYPE_CREDIT/DEAL_TYPE_CHARGE/DEAL_TYPE_CORRECTION DEAL_ENTRY_STATE 

 

     


 
marketeer:

There is a related unanswered question (with a suggestion) -  https://www.mql5.com/en/forum/6036. I think may be MQ shed some light on this?


Thanks marketeer!

 
bvarga128:

Thanks marketeer!

That was just a suggestion. I'm not sure it's correct. This is why I'd prefer to hear an answer from MQ. May be a deal type usage is up to a broker (somehow, via server-side setup), bacause I saw messages that even balance operations were marked by DEAL_ENTRY_IN.
Reason: