const res = await fetch('https://app.trdrs.co/api/risk?broker=rithmic&account=PA-4821-07', {
method: 'PUT',
headers: {
'content-type': 'application/json',
Authorization: `Bearer ${process.env.TRDRS_API_KEY}`,
},
body: JSON.stringify({
"dailyLossEnabled": true,
"dailyLossValue": 1000,
"weeklyLossEnabled": false,
"weeklyLossValue": null,
"dailyProfitEnabled": false,
"dailyProfitValue": null,
"weeklyProfitEnabled": false,
"weeklyProfitValue": null,
"eodCloseEnabled": true,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": true
}),
})
const data = await res.json()curl -X PUT 'https://app.trdrs.co/api/risk?broker=rithmic&account=PA-4821-07' \
-H "Authorization: Bearer $TRDRS_API_KEY" \
-H 'content-type: application/json' \
-d '{"dailyLossEnabled":true,"dailyLossValue":1000,"weeklyLossEnabled":false,"weeklyLossValue":null,"dailyProfitEnabled":false,"dailyProfitValue":null,"weeklyProfitEnabled":false,"weeklyProfitValue":null,"eodCloseEnabled":true,"eodCloseValue":15,"lockSettingsWhenTradingLocked":true}'import requests
url = "https://app.trdrs.co/api/risk"
payload = {
"dailyLossEnabled": True,
"dailyLossValue": 1000,
"weeklyLossEnabled": False,
"weeklyLossValue": None,
"dailyProfitEnabled": False,
"dailyProfitValue": None,
"weeklyProfitEnabled": False,
"weeklyProfitValue": None,
"eodCloseEnabled": True,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dailyLossEnabled' => true,
'dailyLossValue' => 1000,
'weeklyLossEnabled' => false,
'weeklyLossValue' => null,
'dailyProfitEnabled' => false,
'dailyProfitValue' => null,
'weeklyProfitEnabled' => false,
'weeklyProfitValue' => null,
'eodCloseEnabled' => true,
'eodCloseValue' => 15,
'lockSettingsWhenTradingLocked' => 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://app.trdrs.co/api/risk"
payload := strings.NewReader("{\n \"dailyLossEnabled\": true,\n \"dailyLossValue\": 1000,\n \"weeklyLossEnabled\": false,\n \"weeklyLossValue\": null,\n \"dailyProfitEnabled\": false,\n \"dailyProfitValue\": null,\n \"weeklyProfitEnabled\": false,\n \"weeklyProfitValue\": null,\n \"eodCloseEnabled\": true,\n \"eodCloseValue\": 15,\n \"lockSettingsWhenTradingLocked\": true\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))
}HttpResponse<String> response = Unirest.put("https://app.trdrs.co/api/risk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dailyLossEnabled\": true,\n \"dailyLossValue\": 1000,\n \"weeklyLossEnabled\": false,\n \"weeklyLossValue\": null,\n \"dailyProfitEnabled\": false,\n \"dailyProfitValue\": null,\n \"weeklyProfitEnabled\": false,\n \"weeklyProfitValue\": null,\n \"eodCloseEnabled\": true,\n \"eodCloseValue\": 15,\n \"lockSettingsWhenTradingLocked\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dailyLossEnabled\": true,\n \"dailyLossValue\": 1000,\n \"weeklyLossEnabled\": false,\n \"weeklyLossValue\": null,\n \"dailyProfitEnabled\": false,\n \"dailyProfitValue\": null,\n \"weeklyProfitEnabled\": false,\n \"weeklyProfitValue\": null,\n \"eodCloseEnabled\": true,\n \"eodCloseValue\": 15,\n \"lockSettingsWhenTradingLocked\": true\n}"
response = http.request(request)
puts response.read_body{
"settings": {
"broker": "rithmic",
"accountNumber": "PA-4821-07",
"dailyLossEnabled": true,
"dailyLossValue": 1000,
"weeklyLossEnabled": false,
"weeklyLossValue": null,
"dailyProfitEnabled": false,
"dailyProfitValue": null,
"weeklyProfitEnabled": false,
"weeklyProfitValue": null,
"eodCloseEnabled": true,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": true,
"updatedAt": 1787581500
},
"lock": {
"broker": "rithmic",
"accountNumber": "PA-4821-07",
"tradingLocked": false,
"settingsLocked": false,
"lockReason": null,
"lockWindow": null,
"tradingUnlockAt": null,
"settingsUnlockAt": null,
"triggerPnl": null,
"flattenConfirmed": false,
"monitoring": "live",
"settings": {
"broker": "rithmic",
"accountNumber": "PA-4821-07",
"dailyLossEnabled": true,
"dailyLossValue": 1000,
"weeklyLossEnabled": false,
"weeklyLossValue": null,
"dailyProfitEnabled": false,
"dailyProfitValue": null,
"weeklyProfitEnabled": false,
"weeklyProfitValue": null,
"eodCloseEnabled": true,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": true,
"updatedAt": 1787581500
}
}
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Set the risk controls
Replaces the five controls in one write. An enabled control needs a positive, in-range value (loss/profit in account currency; the end-of-day close in whole minutes before the 16:00 CT close, 1-240); a disabled control value is ignored and stored as null. Enforcement is live from the write: the risk monitor re-arms immediately. Refused with 423 settings_locked while the account is settings-locked (the “prevent changes when trading is locked” preference, in force until 16:00 CT after a control fires).
const res = await fetch('https://app.trdrs.co/api/risk?broker=rithmic&account=PA-4821-07', {
method: 'PUT',
headers: {
'content-type': 'application/json',
Authorization: `Bearer ${process.env.TRDRS_API_KEY}`,
},
body: JSON.stringify({
"dailyLossEnabled": true,
"dailyLossValue": 1000,
"weeklyLossEnabled": false,
"weeklyLossValue": null,
"dailyProfitEnabled": false,
"dailyProfitValue": null,
"weeklyProfitEnabled": false,
"weeklyProfitValue": null,
"eodCloseEnabled": true,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": true
}),
})
const data = await res.json()curl -X PUT 'https://app.trdrs.co/api/risk?broker=rithmic&account=PA-4821-07' \
-H "Authorization: Bearer $TRDRS_API_KEY" \
-H 'content-type: application/json' \
-d '{"dailyLossEnabled":true,"dailyLossValue":1000,"weeklyLossEnabled":false,"weeklyLossValue":null,"dailyProfitEnabled":false,"dailyProfitValue":null,"weeklyProfitEnabled":false,"weeklyProfitValue":null,"eodCloseEnabled":true,"eodCloseValue":15,"lockSettingsWhenTradingLocked":true}'import requests
url = "https://app.trdrs.co/api/risk"
payload = {
"dailyLossEnabled": True,
"dailyLossValue": 1000,
"weeklyLossEnabled": False,
"weeklyLossValue": None,
"dailyProfitEnabled": False,
"dailyProfitValue": None,
"weeklyProfitEnabled": False,
"weeklyProfitValue": None,
"eodCloseEnabled": True,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dailyLossEnabled' => true,
'dailyLossValue' => 1000,
'weeklyLossEnabled' => false,
'weeklyLossValue' => null,
'dailyProfitEnabled' => false,
'dailyProfitValue' => null,
'weeklyProfitEnabled' => false,
'weeklyProfitValue' => null,
'eodCloseEnabled' => true,
'eodCloseValue' => 15,
'lockSettingsWhenTradingLocked' => 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://app.trdrs.co/api/risk"
payload := strings.NewReader("{\n \"dailyLossEnabled\": true,\n \"dailyLossValue\": 1000,\n \"weeklyLossEnabled\": false,\n \"weeklyLossValue\": null,\n \"dailyProfitEnabled\": false,\n \"dailyProfitValue\": null,\n \"weeklyProfitEnabled\": false,\n \"weeklyProfitValue\": null,\n \"eodCloseEnabled\": true,\n \"eodCloseValue\": 15,\n \"lockSettingsWhenTradingLocked\": true\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))
}HttpResponse<String> response = Unirest.put("https://app.trdrs.co/api/risk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dailyLossEnabled\": true,\n \"dailyLossValue\": 1000,\n \"weeklyLossEnabled\": false,\n \"weeklyLossValue\": null,\n \"dailyProfitEnabled\": false,\n \"dailyProfitValue\": null,\n \"weeklyProfitEnabled\": false,\n \"weeklyProfitValue\": null,\n \"eodCloseEnabled\": true,\n \"eodCloseValue\": 15,\n \"lockSettingsWhenTradingLocked\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dailyLossEnabled\": true,\n \"dailyLossValue\": 1000,\n \"weeklyLossEnabled\": false,\n \"weeklyLossValue\": null,\n \"dailyProfitEnabled\": false,\n \"dailyProfitValue\": null,\n \"weeklyProfitEnabled\": false,\n \"weeklyProfitValue\": null,\n \"eodCloseEnabled\": true,\n \"eodCloseValue\": 15,\n \"lockSettingsWhenTradingLocked\": true\n}"
response = http.request(request)
puts response.read_body{
"settings": {
"broker": "rithmic",
"accountNumber": "PA-4821-07",
"dailyLossEnabled": true,
"dailyLossValue": 1000,
"weeklyLossEnabled": false,
"weeklyLossValue": null,
"dailyProfitEnabled": false,
"dailyProfitValue": null,
"weeklyProfitEnabled": false,
"weeklyProfitValue": null,
"eodCloseEnabled": true,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": true,
"updatedAt": 1787581500
},
"lock": {
"broker": "rithmic",
"accountNumber": "PA-4821-07",
"tradingLocked": false,
"settingsLocked": false,
"lockReason": null,
"lockWindow": null,
"tradingUnlockAt": null,
"settingsUnlockAt": null,
"triggerPnl": null,
"flattenConfirmed": false,
"monitoring": "live",
"settings": {
"broker": "rithmic",
"accountNumber": "PA-4821-07",
"dailyLossEnabled": true,
"dailyLossValue": 1000,
"weeklyLossEnabled": false,
"weeklyLossValue": null,
"dailyProfitEnabled": false,
"dailyProfitValue": null,
"weeklyProfitEnabled": false,
"weeklyProfitValue": null,
"eodCloseEnabled": true,
"eodCloseValue": 15,
"lockSettingsWhenTradingLocked": true,
"updatedAt": 1787581500
}
}
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Authorizations
Your firm’s API key (the API calls this the tenant key; trdrs_sk_…), server-to-server only.
Query Parameters
A connected broker. Required.
Pick an account within that broker. Validated against the caller's own set; out-of-set is a 400.
Body
RiskSettingsRequest. Replaces the account controls in one write. An enabled control must carry a positive, in-range value (loss/profit in account currency; the end-of-day close in whole minutes, 1-240); a disabled control value is ignored and stored as null. lockSettingsWhenTradingLocked is coerced off when no control is enabled.
Whole minutes before the 16:00 CT close, 1-240.
Response
The controls as stored and the current lock state
RiskStateResponse. The account controls as stored, and the current lock state.
RiskSettings. The five per-account controls: four loss/profit thresholds in account currency and the end-of-day close in whole minutes before the 16:00 CT session close. An enabled control always carries a positive value; a disabled one reads null.
Show child attributes
Show child attributes
RiskLock. The lock and monitoring state the risk monitor holds for one account. tradingLocked is the fail-closed gate every order-placing route reads (423 risk_locked while true); settingsLocked refuses control edits and the manual unlock until settingsUnlockAt.
Show child attributes
Show child attributes