Skip to content

ORDER_INFO Command

Get information from a pending or opened order

Help:

{
    "MSG":"HELP",
    "COMMAND":"ORDER_INFO",
    "DESCRIPTION":"Get information from a pending or opened order using the TICKET number",
    "MANDATORY_TAGS":[
        "TICKET (Integer)"
    ],
    "OPTIONAL_TAGS":[null],
    "ERROR_ID":0,
    "ERROR_DESCRIPTION":"The operation completed successfully"
}

Example:

Single Line command (necessary for MTsocketAPI):

{"MSG":"ORDER_INFO", "TICKET":1383989469}

Same command in Beauty Format:

{
    "MSG":"ORDER_INFO",
    "TICKET":1383989469
}

MTsocketAPI reply:

{
   "MSG":"ORDER_INFO",
   "TRADES":{
      "TICKET":1383989469,
      "MAGIC":0,
      "SYMBOL":"EURUSD",
      "LOTS":0.01,
      "TYPE":"sell",
      "PRICE_OPEN":1.03009,
      "OPEN_TIME":"2025.01.09 22:26:41",
      "STOP_LOSS":0.00000,
      "SWAP":0.00,
      "COMMISSION":0.00,
      "TAKE_PROFIT":0.00000,
      "PROFIT":-0.05,
      "COMMENT":null,
      "EXPIRATION":"1970.01.01 00:00:00"
   },
   "ERROR_ID":0,
   "ERROR_DESCRIPTION":"no error"
}