Sửa lệnh stop-loss
Sửa lệnh stop-loss
curl --request PUT \
--url https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "FPT",
"stopPrice": 123,
"price": 123,
"quantity": 123,
"account": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({symbol: 'FPT', stopPrice: 123, price: 123, quantity: 123, account: '<string>'})
};
fetch('https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}"
payload = {
"symbol": "FPT",
"stopPrice": 123,
"price": 123,
"quantity": 123,
"account": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}"
payload := strings.NewReader("{\n \"symbol\": \"FPT\",\n \"stopPrice\": 123,\n \"price\": 123,\n \"quantity\": 123,\n \"account\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"symbol\": \"FPT\",\n \"stopPrice\": 123,\n \"price\": 123,\n \"quantity\": 123,\n \"account\": \"<string>\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);falseCURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"symbol\": \"FPT\",\n \"stopPrice\": 123,\n \"price\": 123,\n \"quantity\": 123,\n \"account\": \"<string>\"\n}");
CURLcode ret = curl_easy_perform(hnd);{
"isSuccess": true,
"detail": "<string>",
"data": {
"orderId": "<string>",
"symbol": "<string>",
"stopPrice": 123,
"orderType": "<string>",
"price": 123,
"quantity": 123,
"account": "<string>",
"createdTime": "2023-11-07T05:31:56Z",
"status": "<string>",
"bracketOrderId": "<string>",
"specialOrderType": "<string>",
"remainingQty": 123,
"lastCheckTime": "2023-11-07T05:31:56Z",
"lastSliceTime": "2023-11-07T05:31:56Z",
"minSliceIntervalMs": 123,
"childOrderIds": [
"<string>"
],
"filledQty": 123,
"filledAvgPrice": 123
}
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}Ủy quyền
Bearer token used for protected REST API requests.
Tham số đường dẫn
Mã lệnh do stop-order service trả về.
Nội dung
Stop-order replacement payload. orderId is supplied in the path.
Payload for replacing the fields of an existing stop order. The order id is supplied in the path.
Symbol to trade.
"FPT"
B for buy, S for sell.
B, S Trigger price.
Trigger condition comparing market price to stopPrice.
>=, <= Order type sent when the trigger fires. Frontend currently uses LO or MTL.
LO, MTL, MOK, MAK, ATC, ATO, BEST, OPPOSITE, LAST Limit price for LO orders; ignored or optional for market-style order types.
Order quantity sent after the trigger.
Trading account used for the order.
Phản hồi
Response sửa stop-order, data là stop-order đã cập nhật.
Response sửa stop-order, trong đó data là stop order sau khi cập nhật.
Backend đã chấp nhận và xử lý thao tác sửa hay chưa.
Thông điệp thành công hoặc lỗi do service.orderapi trả về.
Object stop-order sau khi cập nhật.
Hide child attributes
Hide child attributes
System stop order id. JSON serialization may also return OrderId depending on backend settings.
Trading symbol.
B for buy, S for sell.
B, S Trigger price.
Trigger condition comparing current market price against stopPrice.
>=, <= Child order type sent when the trigger fires.
Limit price for LO orders; null or ignored for market-style orders.
Requested quantity.
Trading account.
Creation time.
Stop order status, for example PENDING, COMPLETE, CANCELLED, or MODIFIED.
Ma bracket order cha khi stop order la mot leg cua bracket; null voi stop order doc lap.
Loai leg dac biet nhu ENTRY, TAKE_PROFIT hoac STOP_LOSS; null voi stop order doc lap.
Remaining quantity for sliced execution.
Last trigger check time.
Last time a child slice order was sent.
Minimum interval between child slices in milliseconds.
System order ids of child broker orders.
Filled quantity.
Average filled price.
curl --request PUT \
--url https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "FPT",
"stopPrice": 123,
"price": 123,
"quantity": 123,
"account": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({symbol: 'FPT', stopPrice: 123, price: 123, quantity: 123, account: '<string>'})
};
fetch('https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}"
payload = {
"symbol": "FPT",
"stopPrice": 123,
"price": 123,
"quantity": 123,
"account": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}"
payload := strings.NewReader("{\n \"symbol\": \"FPT\",\n \"stopPrice\": 123,\n \"price\": 123,\n \"quantity\": 123,\n \"account\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"symbol\": \"FPT\",\n \"stopPrice\": 123,\n \"price\": 123,\n \"quantity\": 123,\n \"account\": \"<string>\"\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);falseCURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api-gw.verolabs.co/api/v1/orders/modify-stop-order/{orderId}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"symbol\": \"FPT\",\n \"stopPrice\": 123,\n \"price\": 123,\n \"quantity\": 123,\n \"account\": \"<string>\"\n}");
CURLcode ret = curl_easy_perform(hnd);{
"isSuccess": true,
"detail": "<string>",
"data": {
"orderId": "<string>",
"symbol": "<string>",
"stopPrice": 123,
"orderType": "<string>",
"price": 123,
"quantity": 123,
"account": "<string>",
"createdTime": "2023-11-07T05:31:56Z",
"status": "<string>",
"bracketOrderId": "<string>",
"specialOrderType": "<string>",
"remainingQty": 123,
"lastCheckTime": "2023-11-07T05:31:56Z",
"lastSliceTime": "2023-11-07T05:31:56Z",
"minSliceIntervalMs": 123,
"childOrderIds": [
"<string>"
],
"filledQty": 123,
"filledAvgPrice": 123
}
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}{
"error": "<string>",
"message": "<string>",
"detail": "<string>",
"details": "<string>",
"status": 123
}
