Skip to main content

PATCH Controls

Update one or more global controls. Send only the fields you want to change.

Elite

The Management API requires an Elite subscription. See Authentication.

Endpoint​

PATCH https://app.crosstrade.io/v1/api/manage/controls

Headers​

NameRequiredValue
AuthorizationYesBearer <your API token>
Content-TypeYesapplication/json
If-MatchNoETag from a previous read. The request fails with 412 if the controls changed since then.

Body parameters​

NameTypeRequiredConstraintsDescription
closingOnlybooleanNoBlock opening signals on every account
tradingWindow.daysarray of sun mon tue wed thu fri satNoUnique. Empty array turns the window offDays signals are accepted
tradingWindow.startstring HH:MM or nullNoA 5-minute mark. Required when days is not emptyWindow start, New York time
tradingWindow.endstring HH:MM or nullNoA 5-minute mark, different from start. Required when days is not empty. Earlier than start means the window runs past midnightWindow end, New York time
tradingWindow.closingOnlyAfterstring HH:MM or nullNoA 5-minute mark strictly inside the window; null turns it offFrom this time until end, only closing signals are accepted
monitorLockbooleanNoMonitor Lock. Turning it off releases every locked monitor right away
enhancedClosingOnlybooleanNoNinjaTrader onlyEnforce each monitor's Closing Only inside the add-on

Every field is optional, but the result must be valid as a whole: for example, sending tradingWindow.days while no start or end is saved fails with required_when_days_set. The checks that end differs from start and that closingOnlyAfter falls inside the window apply even while days is empty, because saved times take effect as soon as you add a day. Field details are in the Controls field reference.

killSwitch cannot be changed here. Use PUT Kill Switch. You can still send back the whole object from GET Controls: a killSwitch equal to the saved value is ignored.

Code examples​

import requests

resp = requests.patch(
"https://app.crosstrade.io/v1/api/manage/controls",
headers={"Authorization": "Bearer YOUR_TOKEN"},
json={"tradingWindow": {"days": ["mon", "tue", "wed", "thu", "fri"],
"start": "09:30", "end": "15:55"}},
)
print(resp.status_code, resp.json())

Responses​

{
"success": true,
"changed": true,
"data": {
"killSwitch": false,
"closingOnly": true,
"tradingWindow": { "days": [], "start": "09:30", "end": "16:00", "closingOnlyAfter": null },
"monitorLock": false,
"enhancedClosingOnly": false
},
"changedFields": ["closingOnly"],
"delivery": { "status": "immediate", "target": "signal_gate" },
"warnings": [],
"meta": { "requestId": "req_9f2c1a0b7d3e4f51", "etag": "\"c2:Tm90UmVhbEV0YWcwMg\"" }
}

When it takes effect​

closingOnly and the trading window apply to the next incoming webhook signal. They do not affect orders you place through the trading API or directly in your platform. monitorLock is checked the next time a monitor is saved, restarted or deleted. enhancedClosingOnly is sent to the add-on right away, or when it next connects. See Effect timing.

Notes​

  • Sending the same values that are already saved returns changed: false and saves nothing.
  • The trading window days are case-sensitive on the wire: use lowercase mon, tue, and so on.