Update Stop order
The WebSocket connection being used must be pre-authorized with authorization request.
This operation can be performed with request to HTTP API.
Conditional orders do not require collateral, but limit and market orders placed by them do. Ensure that at the time the conditional order is triggered, there will be sufficient funds in the portfolio to cover the exchange order being placed by using order estimation request.
The request creates a new stop order with changed characteristics, automatically canceling the previously created one. To specify the order to be canceled, use its number in the orderid
parameter.
Request
To modify an order, send a message to the established WebSocket connection with the operation code update:stop
containing the new order details.
- Request body
- Schema
{
"opcode": "update:stop",
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"orderId": "18995978560",
"side": "buy",
"quantity": 300,
"condition": "More",
"triggerPrice": 191.33,
"stopEndUnixTime": 1590094740,
"instrument": {
"symbol": "SBER",
"exchange": "MOEX"
},
"board": "TQBR",
"user": {
"portfolio": "D39004"
},
"checkDuplicates": true,
"protectingSeconds": 15,
"activate": true
}
Request body parameters
authorize
— Authorization of WebSocket connectioncreate:market
— Creation of market ordercreate:limit
— Creation of limit ordercreate:stop
— Creation of stop ordercreate:stopLimit
— Creation of stop limit orderupdate:market
— Modification of market orderupdate:limit
— Modification of limit orderupdate:stop
— Modification of stop orderupdate:stopLimit
— Modification of stop limit orderdelete:market
— Cancelation of market orderdelete:limit
— Cancelation of limit orderdelete:stop
— Cancelation of stop orderdelete:stopLimit
— Cancelation of stop limit orderbuy
sell
buy
sell
More
— Current price is higher that trigger priceLess
— Current price is lower than trigger priceMoreOrEqual
— Current price is higher or equal to the trigger priceLessOrEqual
— Current price is lower or equal to the trigger priceMOEX
— Moscow ExchangeSPBX
— SPB Exchange- List of Moscow Exchange codes is available in table
- SPB Exchange securities always have
SPBX
code
Operation code:
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
Transaction side:
Example: buy
Transaction side:
Example: buy
Number of lots
Example: 300
Triggering condition for stop and stop limit orders:
Example: LessOrEqual
Trigger price for stop and stop limit orders
Example: 191.33
Trigger price for stop and stop limit orders
Example: 1590094740
instrument
object
Security data
Security code (Ticker)
Example: SBER
Exchange code:
Example: MOEX
Trading mode code (Board):
Example: TQBR
user
object
User data
Client portfolio ID
Example: D39004
Flag for checking the uniqueness of commands. It is enabled by default, preventing spamming with similar commands. When disabled, speeds up request processing.
Example: true
Protective time. Continuous period of time in seconds, during which the market price of the instrument must satisfy the price and triggering condition specified in the order (triggerPrice
and condition
). It is intended to protect conditional orders from triggering on short-term price fluctuations.
Example: 15
15
Flag to specify whether to create an active or inactive order. An inactive order is displayed in the system, but does not react to the price level until it becomes active. This flag is required when creating a group of orders with the TriggerBracketOrders
type
Example: true
Responses
According to the results of processing the received request, the server will return a message with the corresponding code to the WebSocket connection.
- 200
- 400
Successful request processing report
- Body
- Schema
{
"requestGuid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"httpCode": 200,
"message": "An order has been updated. New order ID is '12346'.",
"orderNumber": "12346"
}
Response body parameters
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
Response HTTP code
Example: 200
Text description of the returned HTTP code
Example: An order has been updated. New order ID is '12346'.
Unique order ID
Example: "12346"
Failed to process the request. Check the validity of the transmitted message and try again.
- Body
- Schema
{
"requestGuid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"httpCode": 400,
"message": "Invalid or unsupported quantity"
}
Response body parameters
The unique identifier of the operation. All incoming messages related to this operation will have this guid
field value
Example: c328fcf1-e495-408a-a0ed-e20f95d6b813
Response HTTP code
Example: 400
Text description of the returned HTTP code
Example: Invalid or unsupported quantity