> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trdrs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Govern account risk

> Five controls that enforce themselves, a halt that only you can lift, and the 409 that stops you lifting somebody else's lock.

A firm governs an issued account two ways, and they are not the same tool. The five risk controls
are automatic: they watch the account and fire on their own. A halt is manual: it blocks new
orders until you say otherwise. Reach for the controls to define the evaluation; reach for a halt
when something about *this* account, right now, needs to stop.

Everything here runs with your partner key against `/api/partner/` routes, and reaches only
accounts your firm issued.

<Steps>
  <Step title="Read the current state">
    [Get an account's risk controls](/api-reference/firm-accounts/get-an-account-s-risk-controls)
    returns the five controls as stored, plus whether trading is blocked and by what.

    ```bash theme={null}
    curl "$TRDRS_API_BASE_URL/api/partner/accounts/risk?account=EVAL-7C21A9" \
      -H "Authorization: Bearer $TRDRS_PARTNER_KEY"
    ```

    `account` is required — a missing one is a `400`. The `settings` object carries each control's
    enabled flag and value, plus `updatedAt`.
  </Step>

  <Step title="Write all five in one call">
    [Set an account's risk controls](/api-reference/firm-accounts/set-an-account-s-risk-controls)
    replaces the whole set. Enforcement is live from the write: the risk monitor re-arms
    immediately.

    ```bash theme={null}
    curl -X PUT "$TRDRS_API_BASE_URL/api/partner/accounts/risk" \
      -H "Authorization: Bearer $TRDRS_PARTNER_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "accountNumber": "EVAL-7C21A9",
        "dailyLossEnabled": true,    "dailyLossValue": 1000,
        "weeklyLossEnabled": true,   "weeklyLossValue": 3000,
        "dailyProfitEnabled": false,
        "weeklyProfitEnabled": false,
        "eodCloseEnabled": true,     "eodCloseValue": 15
      }'
    ```

    An enabled control needs a positive, in-range value or the write is a `400`. A disabled
    control's value is ignored and stored as null — there is no half-set control. The response
    returns the state as stored, so your system can mirror it rather than assume it.
  </Step>

  <Step title="Halt an account, and lift your own halt">
    [Halt trading](/api-reference/firm-accounts/halt-trading-on-an-account) blocks all new orders
    until your firm resumes.
    [Resume](/api-reference/firm-accounts/resume-trading-on-an-account) is the mirror image.

    ```bash theme={null}
    curl -X POST "$TRDRS_API_BASE_URL/api/partner/accounts/halt" \
      -H "Authorization: Bearer $TRDRS_PARTNER_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "accountNumber": "EVAL-7C21A9" }'
    ```

    Both are idempotent: halting an already-halted account answers `halted: true` again, and
    resuming one that is already trading answers `halted: false`.
  </Step>

  <Step title="Reset when you want the account flat and clean">
    A halt stops new risk; it does not close anything. [Reset an issued
    account](/api-reference/firm-accounts/reset-an-issued-account) is the call that clears open
    positions and working orders and returns the balance to its starting figure.

    ```bash theme={null}
    curl -X POST "$TRDRS_API_BASE_URL/api/partner/accounts/reset" \
      -H "Authorization: Bearer $TRDRS_PARTNER_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "accountNumber": "EVAL-7C21A9", "referenceId": "reset-84117-2" }'
    ```
  </Step>
</Steps>

## The five controls

| Control             | Value's unit            | What it does                                       |
| ------------------- | ----------------------- | -------------------------------------------------- |
| `dailyLossValue`    | account currency        | Fires when the day is down this much.              |
| `weeklyLossValue`   | account currency        | Fires when the week is down this much.             |
| `dailyProfitValue`  | account currency        | Fires when the day is up this much.                |
| `weeklyProfitValue` | account currency        | Fires when the week is up this much.               |
| `eodCloseValue`     | whole minutes, 1 to 240 | Fires this many minutes before the 16:00 CT close. |

The end-of-day window is the one control that is not about money. Its value is a count of whole
minutes before the 16:00 CT close, and the contract accepts 1 through 240 — anything outside that
range is a `400`, not a clamp. Four hours is the ceiling because the control is a
close-out-before-the-bell instrument, not a session policy.

## What firing does

The same thing, whichever control fired: **flatten, then lock**. The risk monitor closes the
account's positions and blocks new orders, exactly as if the trader had set the control
themselves. Nothing about a firm-written control is enforced differently from a trader-written
one — it is the same monitor reading the same settings row.

After a control fires, `halted` is `true` and `lockReason` names what fired.

| `lockReason`                                                              | What it is            | Who clears it            |
| ------------------------------------------------------------------------- | --------------------- | ------------------------ |
| `firm_halt`                                                               | Your own halt.        | You, with resume.        |
| `daily_loss`, `weekly_loss`, `daily_profit`, `weekly_profit`, `eod_close` | A control fired.      | The period reset.        |
| `eval_breach`                                                             | The evaluation ended. | Nobody — it is terminal. |
| `null`                                                                    | Trading.              | —                        |

## Halt, resume, reset — which one

|        | Blocks new orders | Closes open positions           | Clears             | Survives a restart |
| ------ | ----------------- | ------------------------------- | ------------------ | ------------------ |
| Halt   | yes               | no                              | your resume        | yes                |
| Resume | —                 | no                              | only a `firm_halt` | —                  |
| Reset  | no                | yes, and cancels working orders | —                  | —                  |

Two refusals hold this together, and both are `409`:

* **Halt refuses when someone else already holds the lock.** If the account is locked by a risk
  control that fired or by an evaluation breach, the halt answers `409` and replaces nothing —
  because clearing your halt later must never release a lock you never owned.
* **Resume refuses when the lock is not yours.** It clears a `firm_halt` and nothing else. A risk
  lock or an `eval_breach` stands, and `lockReason` in the error names what is actually holding it.

A halt deliberately leaves positions open: stopping new risk should not force an exit at whatever
the current price happens to be. If you want the account flat, reset it.

## How this differs from a trader's own controls

They are the same five numbers in the same settings row — one set, two viewers, last write wins.
What differs is the key, the naming, and the reach.

|                            | Your firm's surface                                                                           | The trader's own                                                                                         |
| -------------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Key                        | partner key                                                                                   | tenant key                                                                                               |
| Read                       | [Get an account's risk controls](/api-reference/firm-accounts/get-an-account-s-risk-controls) | [Get the risk state](/api-reference/account/get-the-risk-state)                                          |
| Write                      | [Set an account's risk controls](/api-reference/firm-accounts/set-an-account-s-risk-controls) | [Set the risk controls](/api-reference/account/set-the-risk-controls)                                    |
| Naming the account         | `accountNumber` in the body                                                                   | `broker` + `account` query parameters                                                                    |
| Scope                      | only accounts your firm issued through the API                                                | any account the caller has connected                                                                     |
| Can block trading outright | yes, with halt and resume                                                                     | no                                                                                                       |
| Can clear a lock           | only its own `firm_halt`                                                                      | [its own risk lock](/api-reference/account/clear-the-risk-lock), never a `firm_halt` or an `eval_breach` |

One field belongs to the trader alone: the "prevent changes while locked" preference is not on the
partner surface at all, and your write leaves it untouched.

## Where to go deeper

* [Issue evaluation accounts](/guides/issue-accounts) — creating the accounts these controls govern.
* [Set risk controls](/guides/manage-risk-controls) — the trader-side view of the same five numbers, and the `423` they produce.
* [Receive events](/guides/receive-events) — `risk.locked` and `risk.unlocked` as they happen.
* [Close a position](/guides/close-a-position) — what the monitor's own flatten does.
* [Errors](/partner-platform/overview/errors) — every status this surface can answer.
