Skip to content
Cirrus home
Sign in

Guide

Loss limits, profit lock and targets

Stop trading for the day at a loss limit, lock in profit once it reaches a level, or exit everything at a profit target.

A risk_limit trigger watches the mark-to-market (MTM) of one account or of all your accounts together, and acts when a limit is reached. It has no legs. Needs the triggers scope.

A daily loss limit #

POST
curl -X POST "https://cirrus.pocketful.in/v2/triggers" \
  -H "Authorization: token $CIRRUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "P1",
    "kind": "risk_limit",
    "spec": {
      "level": "account",
      "mtm_floor": -5000,
      "on_breach": "flatten"
    }
  }'

Lock in profit #

Once MTM reaches arm_at, a floor is set at floor. If MTM falls back to it, the limit acts. Combine it with a loss limit in the same trigger:

POST
curl -X POST "https://cirrus.pocketful.in/v2/triggers" \
  -H "Authorization: token $CIRRUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "P1",
    "kind": "risk_limit",
    "spec": {
      "level": "user",
      "mtm_floor": -10000,
      "profit_lock": {
        "arm_at": 8000,
        "floor": 5000
      },
      "on_breach": "flatten"
    }
  }'

A profit target #

Use a condition on the MTM variables (account.mtm, user.mtm). This one only notifies, so you decide:

POST
curl -X POST "https://cirrus.pocketful.in/v2/triggers" \
  -H "Authorization: token $CIRRUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "P1",
    "kind": "risk_limit",
    "spec": {
      "level": "account",
      "when": "account.mtm >= 15000",
      "on_breach": "notify"
    }
  }'
on_breachWhat happens
flatten (default)Exits every open position at market.
pauseStops new entries; open positions stay.
notifyOnly tells you.

Limits for automated strategies #

Automated strategies also share one daily loss limit and exposure cap. With close_on_breach, reaching the loss limit closes every open strategy trade:

PUT
curl -X PUT "https://cirrus.pocketful.in/v2/strategies/risk-limits" \
  -H "Authorization: token $CIRRUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "max_daily_loss": 15000,
    "max_open_exposure": 300000,
    "close_on_breach": true
  }'
Response · 200
{
  "status": "success",
  "data": {
    "max_daily_loss": 15000,
    "max_open_exposure": 300000,
    "close_on_breach": true,
    "updated_at": "2026-10-22T15:22:21.147Z"
  },
  "error": null
}

In the reference