API documentation

Daily drawdown

A daily loss limit for each account, checked on the server every second — not every few minutes by your own polling. Choose the time zone of the day, the prop-firm rule, what happens on a breach, and switch it on or off per account.

Updated

How it works

  • Every ACTIVE account can have one daily drawdown limit. The gateway reads the account's live equity every second and compares the drop since the start of the day with your limit — a spike between two of your requests is not missed. When the gateway was not watching for a moment (a reconnect, a restart), the lowest equity of the minutes missed counts too — with confirmSec 0 only: a confirmation time needs live readings.
  • The day starts at midnight of resetTimezone (or of the broker server). Its start figures are the balance and equity at that minute. When the account was not watched then, the balance is rebuilt from the deals booked since, and the equity adds the floating profit of the last minute the gateway saw before midnight (within 7 days; else credit only).
  • Deposits, withdrawals and credit booked during the day are not a drawdown: equity is measured without them.
  • The first day starts when you set the limit (not at the midnight before), so a loss made before it never counts: when the account was not watched at that moment, the floating profit first seen stands for the one then. A STANDBY account is not measured (measuring: false).
  • The limit is listed with the account's risk trackers (kind: DAILY_DRAWDOWN) but changed only here, and it does not count against the 10 trackers per account.

Set the limit

PUT /v1/accounts/{id}/daily-drawdown takes the whole setting. Sending the same body again changes nothing (a safe retry); a field you leave out goes back to its default (none for the limits, the adjustment and the time zone). Only restartId is kept when left out; "restartId": null clears it, which starts the day over.

FieldRule
maxDrawdownPctLimit in % — of the base, or of the day's start balance with percentOf START_BALANCE. Give this, maxDrawdownAbs, or both (whichever is reached first counts).
maxDrawdownAbsLimit in account currency, e.g. 5 % of a 100 000 account size = 5000.
baseWhat the drawdown is measured from at the start of the day: BALANCE, EQUITY or HIGHER (default, the higher of the two).
percentOfBASE (default): the percentage is a share of the base. START_BALANCE: a share of the day's start balance (plus balanceAdjust), while the drawdown is still measured from the base.
balanceAdjustAdded to the start balance for percentOf START_BALANCE — e.g. minus the payouts you booked outside MetaTrader. null: none.
resetTimezoneIANA time zone whose midnight starts the day: UTC, Europe/London, America/New_York, Asia/Tehran… (daylight saving included). Omitted: the broker server's midnight.
actionNOTIFY (event only, default), CLOSE_POSITIONS (close everything), CLOSE_AND_BLOCK (close everything and refuse new orders until the day ends). The last two need a key with the trade permission.
confirmSec0–300 (default 0). The drawdown must stay over the limit this many seconds — every reading in between over it — before it counts. 10 keeps one bad tick from failing an account.
restartIdYour id of the current start, e.g. challenge-id:phase. A different id ends the running day now and starts a new one; the same id again changes nothing.
enabledtrue (default) or false: kept but not measured.
bash
# prop rule: 5 % daily loss, measured from the start-of-day equity, limit = 5 % of the start-of-day balance,
# the day starts at 00:00 UTC; on a breach close everything and block new orders until the next day
curl -X PUT https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY" \
  -H "Content-Type: application/json" -d '{
    "maxDrawdownPct": 5,
    "base": "EQUITY",
    "percentOf": "START_BALANCE",
    "resetTimezone": "UTC",
    "action": "CLOSE_AND_BLOCK",
    "confirmSec": 10,
    "restartId": "challenge-8812:phase-1"
  }'
# 201 the first time, 200 after that:
# → { "id": "…", "enabled": true, "measuring": true, "maxDrawdownPct": 5, "base": "EQUITY", "percentOf": "START_BALANCE",
#     "resetTimezone": "UTC", "action": "CLOSE_AND_BLOCK", "confirmSec": 10, "restartId": "challenge-8812:phase-1",
#     "activeFrom": "2026-10-15T13:02:11.204Z", "blocked": false, "today": null, "created": true, "restarted": false }
# ("today" appears within a second or two, once the engine has opened the day)

Or set it together with the account: the optional dailyDrawdown field of POST /v1/accounts takes the same body (see Accounts & brokers).

bash
# the same setting when you register the account (repeat-safe: registering it again with it changes nothing)
curl -X POST https://api.propmetaapi.com/v1/accounts -H "Authorization: Bearer $GW_KEY" -H "Content-Type: application/json" -d '{
    "platform": "MT5", "broker": "Exness", "server": "Exness-MT5Trial12",
    "login": "123456789", "masterPassword": "…",
    "dailyDrawdown": { "maxDrawdownAbs": 5000, "base": "EQUITY", "resetTimezone": "UTC", "action": "CLOSE_AND_BLOCK", "confirmSec": 10 }
  }'
# → the account, with "dailyDrawdown": { … } — then check and activate it as usual

Prop-firm rules

Your ruleSetting
Loss from the start-of-day equity, limit x % of the start-of-day balancebase: EQUITY, percentOf: START_BALANCE, maxDrawdownPct: x
Loss from the higher of balance and equity at the start of the day, x % of itbase: HIGHER, maxDrawdownPct: x
A fixed amount, e.g. x % of the account sizebase: EQUITY (or BALANCE), maxDrawdownAbs: size × x / 100
Payouts you pay outside MetaTrader reduce the balance the limit is taken ofbalanceAdjust: −total paid (PATCH it after each payout)
The day resets at midnight of your firm's time zoneresetTimezone, e.g. UTC or Europe/Prague

A weekly or overall limit is not part of this route: keep it in your own system, or use a risk tracker with period WEEK, MONTH or LIFETIME.

On a breach

  • The gateway raises DAILY_DRAWDOWN_BREACHED once per day (once per start: after a restart the new day can raise it again) — in the event feed, over the WebSocket and to your webhooks. It carries your restartId and the day's figures.
  • CLOSE_POSITIONS closes every position and pending order (a few tries). CLOSE_AND_BLOCK does the same and answers new orders with 422 TRADE_NOT_ALLOWED until the day ends; a position opened from another terminal (desktop, phone) is closed again within about 30 s. Closing, modifying and cancelling stay allowed.
  • Closing needs the account's master password: with a rejected or missing one the event is still sent, positions stay open.
  • GET /v1/accounts/{id}/daily-drawdown shows blocked: true and today.breachedAt. The block ends at today.periodEnd, on a restart, when you switch the limit off or change action to NOTIFY or CLOSE_POSITIONS, or when you remove it. The breach stays recorded: switched on again the same day, the block is back.
json
{
  "id": "48213", "type": "DAILY_DRAWDOWN_BREACHED", "accountId": "3f0c…", "occurredAt": "2026-10-15T14:21:07.512Z",
  "restartId": "challenge-8812:phase-1",
  "periodStart": "2026-10-15T00:00:00.000Z", "periodEnd": "2026-10-16T00:00:00.000Z",
  "startBalance": 100000, "startEquity": 99620.5, "base": 99620.5, "percentBase": 100000,
  "equity": 94618.3, "drawdown": 5002.2, "drawdownPct": 5.0022, "limitPct": 5, "limitAbs": null,
  "balance": 96110, "cashFlow": 0, "percentOf": "START_BALANCE", "resetTimezone": "UTC",
  "confirmSec": 10, "action": "CLOSE_AND_BLOCK", "tracker": "…", "name": "@daily-drawdown", "period": "DAY"
}

# only these events from the feed (nextAfter still moves past the other types)
curl "https://api.propmetaapi.com/v1/events?after=$CURSOR&types=DAILY_DRAWDOWN_BREACHED" -H "Authorization: Bearer $GW_KEY"

Start the day over

When something on your side starts the trader's day over — the next phase on the same account, a breach you voided, a new trader on a fresh account — send the setting with a new restartId. The running day ends at once (its breach and block end with it) and a new day starts from the current figures. Changing base, percentOf or resetTimezone starts the day over too. Use an id you can rebuild (challenge + phase + a counter): retries with the same id never restart twice, and an event whose restartId is not your current one belongs to the old start.

bash
# the trader passed phase 1 on the same account: a new restartId ends the running day now
# (its breach and block with it) and starts a new day from the current figures
curl -X PUT https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY" -H "Content-Type: application/json" -d '{
    "maxDrawdownPct": 5, "base": "EQUITY", "percentOf": "START_BALANCE", "resetTimezone": "UTC",
    "action": "CLOSE_AND_BLOCK", "confirmSec": 10, "restartId": "challenge-8812:phase-2"
  }'
# → { …, "restarted": true, "blocked": false, "today": null }   (the new day appears within a second or two)

Read, switch off, change, remove

bash
curl https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY"
# → { …, "blocked": false,
#     "today": { "periodStart": "2026-10-15T00:00:00.000Z", "periodEnd": "2026-10-16T00:00:00.000Z",
#                "startBalance": 100000, "startEquity": 99620.5, "startSource": "BAR", "base": 99620.5,
#                "equity": 98410.2, "minEquity": 97950.1, "maxDrawdown": 1670.4, "maxDrawdownPct": 1.6704,
#                "breachedAt": null, "closeCommands": 0, … } }

curl "https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown/days?limit=30" -H "Authorization: Bearer $GW_KEY"   # the days, newest first
curl https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID -H "Authorization: Bearer $GW_KEY"                                  # the account, with "dailyDrawdown"
bash
# switch off (kept, not measured: no breach, no block) and on again
curl -X PATCH https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY" -H "Content-Type: application/json" -d '{ "enabled": false }'
curl -X PATCH https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY" -H "Content-Type: application/json" -d '{ "enabled": true }'

# a new limit for the running day, or a payout of 2000 you booked outside MetaTrader
curl -X PATCH https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY" -H "Content-Type: application/json" -d '{ "maxDrawdownPct": 4 }'
curl -X PATCH https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY" -H "Content-Type: application/json" -d '{ "balanceAdjust": -2000 }'

# remove it (and its days)
curl -X DELETE https://api.propmetaapi.com/v1/accounts/$ACCOUNT_ID/daily-drawdown -H "Authorization: Bearer $GW_KEY"
  • Switching on again does not look at the lows of the minutes the limit was off; a loss still on the books then counts against the day's start figures at once.
  • A new limit applies to the running day; a breach already recorded stays.
  • Reading needs a key with read; PUT, PATCH and DELETE need manage (and trade for the closing actions).

Good to know

The limit is measured while the account is ACTIVE and its terminal connected. While it is disconnected nothing is read; on reconnect the lowest equity of the minutes in between is checked (with confirmSec 0). Keep the accounts you monitor ACTIVE.