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)", "ASYNC (Boolean)" ], "ERROR_ID":0, "ERROR_DESCRIPTION":"The operation completed successfully", "DEMO":"MTsocketAPI running in DEMO mode (www.mtsocketapi.com)" }
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":2012142959,
"SL":1.002
}
MTsocketAPI reply:
{
"MSG":"ORDER_MODIFY",
"TICKET":2012142959,
"RETCODE":10009,
"DEAL":0,
"ORDER":0,
"VOLUME":0.00,
"PRICE":0.000000,
"BID":0.000000,
"ASK":0.000000,
"REQUEST_ID":3136973156,
"RETCODE_EXTERNAL":0,
"ERROR_ID":0,
"ERROR_DESCRIPTION":"The operation completed successfully"
}
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.