Skip to main content
Five controls sit on every account: a daily loss limit, a weekly loss limit, a daily profit target, a weekly profit target, and an end-of-day close. When one fires, the risk monitor flattens the account and locks trading until the period resets. That lock is the 423 every order-placing route answers. Read it before you trade, and display it rather than retrying through it.
1

Read the state

Get the risk state returns the controls as stored and the current lock. broker is required here — risk controls are per account, never a priority default.
The same lock object streams live as the lock event on the account stream, so a client that is already streaming does not poll this route.
2

Set the controls

Set the risk controls replaces all five in one write. Enforcement is live from the write: the monitor re-arms immediately.
An enabled control needs a positive, in-range value. A disabled control’s value is ignored and stored as null — you cannot half-set a control.
3

Clear a lock you own

Clear the risk lock clears the trading lock and the fired-control latches, so any control can protect again this period. The body is empty.
Two locks are not yours to clear. An eval_breach or a firm_halt lock stands: the call succeeds and the lock remains, released by the evaluation lifecycle or by the firm’s own resume.

The five controls

lockSettingsWhenTradingLocked is the sixth field and not a control. It says that when a control locks trading, the settings lock too — until 16:00 CT — so the lock cannot be undone mid-period. It is coerced off while no control is enabled.

Reading the lock

So the settings lock is a real thing to design around: after a control fires with lockSettingsWhenTradingLocked on, both the control edit and the manual unlock are refused with 423 until 16:00 CT. A hard lock cannot be self-cleared early.

A trader’s controls versus a firm’s

The same five numbers have two surfaces, and which one you use depends on which key you hold. These are the same settings row: one set of numbers, two viewers, last write wins. The firm write returns the state as stored so your system can mirror it, and the trader’s “prevent changes while locked” preference is not on the partner surface at all — your write leaves it alone.
A halt is not a risk control. It blocks all new orders on one firm-issued account until your firm resumes it, it is durable across an engine restart, and the trader’s manual unlock cannot clear it. Open positions are not flattened — a halt stops new risk without forcing an exit at the current price. It is idempotent, and if the account is already locked by something that is not yours, halt answers 409 and replaces nothing, because clearing your halt later must never release a lock you never owned. Resume is the mirror image: it clears only a firm_halt, and answers 409 when the lock is somebody else’s.

Where to go deeper