Download MetaTrader 5

DEAL_ENTRY_STATE

To add comments, please log in or register
Find out how to install MetaTrader on Linux
bvarga128
24
bvarga128 2014.08.27 15:44 

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

Jose Miguel Soriano
4963
Jose Miguel Soriano 2014.08.27 20:12  
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);
}
Alain Verleyen
Moderator
30737
Alain Verleyen 2014.08.27 20:18  
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.
Stanislav Korotky
17924
Stanislav Korotky 2014.08.27 21:51  

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 

 

     


bvarga128
24
bvarga128 2014.08.28 09:16  
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!

Stanislav Korotky
17924
Stanislav Korotky 2014.08.28 10:54  
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.
To add comments, please log in or register