Skip to content

ModifyOpenTrade

Modifies SL and/or TP for an existing open market position.

PUT

https://{some_domain}/trade/modify/open

Compatibility note:

  • PUT /trade/modify is kept as a backward-compatible alias for this method

Authorization

All requests must include a JWT token:

Authorization: <JWT_TOKEN>

Request

Content-Type: application/json

Body Parameters

Field Type Required Description
order int Yes Trade order ID
sl double No New Stop Loss
tp double No New Take Profit

At least one of sl or tp must be provided.

This method works only for open market trades with:

  • cmd = OP_BUY
  • cmd = OP_SELL

Response

Success (200)

The response is an acknowledgment that the update request was accepted into runtime processing.

{
  "accepted": true,
  "order": 123456,
  "state": 14,
  "login": 1001,
  "symbol": "EURUSD",
  "cmd": 0,
  "volume": 100
}

state = 14 corresponds to TS_OPEN_UPDATE_REQUEST.

Error Responses

Code Error Description
400 INVALID_DATA Validation failed or no mutable fields were provided
401 PERMISSION_DENIED Access denied
403 MODIFY_TRADE_ERROR Order does not belong to the authenticated user
400/409 RET_TRADE_INCORRECT_CMD The target order is not an open market position
4xx/5xx RET_* Validation/runtime error returned by trade checks