ordertype() in mql5 ?

 
hi guys  how can substitute  OrderType() in mql5 ?  thanks
 

https://www.mql5.com/en/docs/constant_indices

look at this. you will get the answer.

Documentation on MQL5: List of MQL5 Constants
Documentation on MQL5: List of MQL5 Constants
  • www.mql5.com
All MQL5 constants in alphabetical order...
 
thanks  i think in this mode is correct  ENUM_ORDER_TYPE type = PositionGetInteger(POSITION_TYPE);
 

Hi

Here there are separate enum values for deals. orders and positions in mt5.

You should use proper ones for each of them, for example you should use:

ENUM_POSITION_TYPE postype=PositionGetInteger(POSITION_TYPE) – and you can get Buy or Sell only

When you check the type for orders:

ENUM_ORDER_TYPE ordtype = OrderGetInteger(ORDER_TYPE);

you will get the types as in mt4  - but this will work only for orders.

You can also get deal type: HistoryDealGetInteger(deal_ticket,DEAL_TYPE)

Have a nice weekend