Skip to content

ORDER_MODIFY Command

Change SL or TP for market or limit orders

Help
{
    "MSG":"HELP",
    "COMMAND":"ORDER_MODIFY",
    "DESCRIPTION":"Modify any order using the TICKET number",
    "MANDATORY_TAGS":["TICKET (Integer)"],
    "OPTIONAL_TAGS":[
        "PRICE (Double)",
        "SL (Double)",
        "TP (Double)",
        "EXPIRATION (String)"
    ]
}

Example

Single Line command (necessary for MTsocketAPI):

{"MSG":"ORDER_MODIFY", "TICKET":6549871, "SL":1.002, "TP":0}

Same command in Beauty Format:

{
    "MSG":"ORDER_MODIFY",
    "TICKET":6549871,
    "SL":1.002,
    "TP":0
}

MTsocketAPI reply:

{
    "MSG":"ORDER_MODIFY",
    "TICKET":6549871,
    "ERROR_ID":0,
    "ERROR_DESCRIPTION":"no error"
}
Important

If you send the SL or TP tag, the value will be updated but if you send the SL or TP tag assigned to 0 then the SL or TP will be removed.