Sửa cấu hình cắt lỗ
curl --request PATCH \
--url https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cutLossRate": 123,
"investorAccountId": 123,
"trailingEnabled": true,
"investorId": 123,
"autoIncreaseDealRate": true,
"enableAutoDealDepositNoti": true
}
'import requests
url = "https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}"
payload = {
"cutLossRate": 123,
"investorAccountId": 123,
"trailingEnabled": True,
"investorId": 123,
"autoIncreaseDealRate": True,
"enableAutoDealDepositNoti": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cutLossRate: 123,
investorAccountId: 123,
trailingEnabled: true,
investorId: 123,
autoIncreaseDealRate: true,
enableAutoDealDepositNoti: true
})
};
fetch('https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cutLossRate' => 123,
'investorAccountId' => 123,
'trailingEnabled' => true,
'investorId' => 123,
'autoIncreaseDealRate' => true,
'enableAutoDealDepositNoti' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}"
payload := strings.NewReader("{\n \"cutLossRate\": 123,\n \"investorAccountId\": 123,\n \"trailingEnabled\": true,\n \"investorId\": 123,\n \"autoIncreaseDealRate\": true,\n \"enableAutoDealDepositNoti\": true\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cutLossRate\": 123,\n \"investorAccountId\": 123,\n \"trailingEnabled\": true,\n \"investorId\": 123,\n \"autoIncreaseDealRate\": true,\n \"enableAutoDealDepositNoti\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cutLossRate\": 123,\n \"investorAccountId\": 123,\n \"trailingEnabled\": true,\n \"investorId\": 123,\n \"autoIncreaseDealRate\": true,\n \"enableAutoDealDepositNoti\": true\n}"
response = http.request(request)
puts response.read_body{
"investorId": 123,
"investorAccountId": 123,
"cutLossRate": 123,
"trailingEnabled": true,
"createdDate": "<string>",
"modifiedDate": "<string>",
"maxCutLossRate": 123,
"autoIncreaseDealRate": true,
"enableAutoDealDepositNoti": true,
"defaultTakeProfitRate": 123,
"defaultTakeProfitPriceDelta": 123,
"defaultTakeProfitEnabled": true,
"defaultTakeProfitType": "<string>",
"defaultTakeProfitOrderDelta": 123,
"defaultTakeProfitOrderStrategy": "<string>"
}{
"code": "<string>",
"message": "<string>",
"status": 123
}{
"code": "<string>",
"message": "<string>",
"status": 123
}Tài khoản
Sửa cấu hình cắt lỗ
Sửa cấu hình mặc định cắt lỗ (cut loss config).
PATCH
/
risk_configs
/
{investorAccountId}
Sửa cấu hình cắt lỗ
curl --request PATCH \
--url https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cutLossRate": 123,
"investorAccountId": 123,
"trailingEnabled": true,
"investorId": 123,
"autoIncreaseDealRate": true,
"enableAutoDealDepositNoti": true
}
'import requests
url = "https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}"
payload = {
"cutLossRate": 123,
"investorAccountId": 123,
"trailingEnabled": True,
"investorId": 123,
"autoIncreaseDealRate": True,
"enableAutoDealDepositNoti": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cutLossRate: 123,
investorAccountId: 123,
trailingEnabled: true,
investorId: 123,
autoIncreaseDealRate: true,
enableAutoDealDepositNoti: true
})
};
fetch('https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cutLossRate' => 123,
'investorAccountId' => 123,
'trailingEnabled' => true,
'investorId' => 123,
'autoIncreaseDealRate' => true,
'enableAutoDealDepositNoti' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}"
payload := strings.NewReader("{\n \"cutLossRate\": 123,\n \"investorAccountId\": 123,\n \"trailingEnabled\": true,\n \"investorId\": 123,\n \"autoIncreaseDealRate\": true,\n \"enableAutoDealDepositNoti\": true\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cutLossRate\": 123,\n \"investorAccountId\": 123,\n \"trailingEnabled\": true,\n \"investorId\": 123,\n \"autoIncreaseDealRate\": true,\n \"enableAutoDealDepositNoti\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.entrade.com.vn/entrade-api/risk_configs/{investorAccountId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cutLossRate\": 123,\n \"investorAccountId\": 123,\n \"trailingEnabled\": true,\n \"investorId\": 123,\n \"autoIncreaseDealRate\": true,\n \"enableAutoDealDepositNoti\": true\n}"
response = http.request(request)
puts response.read_body{
"investorId": 123,
"investorAccountId": 123,
"cutLossRate": 123,
"trailingEnabled": true,
"createdDate": "<string>",
"modifiedDate": "<string>",
"maxCutLossRate": 123,
"autoIncreaseDealRate": true,
"enableAutoDealDepositNoti": true,
"defaultTakeProfitRate": 123,
"defaultTakeProfitPriceDelta": 123,
"defaultTakeProfitEnabled": true,
"defaultTakeProfitType": "<string>",
"defaultTakeProfitOrderDelta": 123,
"defaultTakeProfitOrderStrategy": "<string>"
}{
"code": "<string>",
"message": "<string>",
"status": 123
}{
"code": "<string>",
"message": "<string>",
"status": 123
}Ủy quyền
JWT token lấy từ API đăng nhập.
Tham số đường dẫn
Mã tài khoản của khách hàng
Nội dung
application/json
Phản hồi
Thành công - sửa cấu hình cắt lỗ
- Option 1
- Option 2
Mã khách hàng
Mã tài khoản
Mức cắt lỗ hiện tại
Có đang bật lệnh cắt lỗ hay không
Thời điểm (ngày giờ) đặt lệnh, theo định dạng ISO UTC 8601 format datetime. Ví dụ: 2022-07-15T10:00:00.111+07:00
Thời điểm (ngày giờ) thay đổi cuối cùng của lệnh
Mức cắt lỗ tối đa
Bật tắt tự động nộp cọc vào deal