Skip to main content
PATCH
Update a trading rule

Authorizations

X-API-Key
string
header
required

Organization API key (hp_live_...), sent in the X-API-Key header. Create, rotate and restrict keys in the dashboard or with the API keys endpoints; an organization can have two active keys, so you can rotate without downtime. A full-access key can call every endpoint in this reference. A read-only key can call GET endpoints (and create a trading stream token); any other request returns 403 READ_ONLY_KEY. A key with an IP allowlist returns 403 IP_NOT_ALLOWED from any other address. Each endpoint lists which keys can call it under Access.

Headers

Idempotency-Key
string

Optional. A value that identifies this operation on your side, at most 255 characters. A retry with the same key, method, path and body within 24 hours returns the original response (with Idempotency-Replayed: true) instead of repeating the change. The same key with a different body returns 409 IDEMPOTENCY_KEY_REUSED; a retry while the first request is still running returns 409 IDEMPOTENCY_KEY_IN_PROGRESS. A response that contains a credential (such as a new API key or signing secret) is not saved: the change is still not repeated, and a retry returns 409 IDEMPOTENCY_KEY_COMPLETED with the original status in originalStatus. Server errors (5xx) are not saved, so a retry runs again. If the key cannot be recorded, the request is not run and returns 503 IDEMPOTENCY_UNAVAILABLE; retry with the same key.

Maximum string length: 255

Path Parameters

ruleId
string
required

The rule ID to update

Body

application/json
name
string

New rule name (must be unique)

Maximum string length: 200
Example:

"Updated Rule Name"

description
string

New description (null to clear)

Maximum string length: 2000
Example:

"Updated description"

profitTarget
integer

New profit target

Required range: 0 <= x <= 100000000
Example:

12000

dailyProfit
integer

New daily profit cap

Required range: 0 <= x <= 100000000
dailyProfitEnforced
boolean

Turn engine enforcement of dailyProfit on or off

bestDayStopPct
integer

New best-day stop percent of profitTarget (0 or null = off)

Required range: 0 <= x <= 100
Example:

40

maxProfit
integer

New max profit cap

Required range: 0 <= x <= 100000000
dailyLossEntryBufferTicks
integer

New daily-loss entry buffer in ticks per contract (0 or null = off)

Required range: 0 <= x <= 100
Example:

4

dailyLoss
integer

New daily loss limit

Required range: 0 <= x <= 100000000
Example:

3000

maxLoss
integer

New max loss limit

Required range: 0 <= x <= 100000000
Example:

6000

dailyDrawdown
integer

New daily drawdown limit: a whole-number percent of the day's starting balance (2 = 2%)

Required range: 0 <= x <= 100
maxDrawdown
integer

New max drawdown limit

Required range: 0 <= x <= 100000000
drawdownType
enum<string>

Change drawdown calculation method

Available options:
static,
trailing,
eod
drawdownDenomination
enum<string>

Unit of maxDrawdown. "percent" (default) = % of the reference. "dollars" = a fixed dollar amount below the reference — required for zero-based (e.g. $0 sim funded) accounts, where any percent of $0 is a $0 floor. Example: drawdownType "trailing" + denomination "dollars" + maxDrawdown 1000 = a $1,000 trailing max loss whose floor starts at -$1,000.

Available options:
percent,
dollars
Example:

"percent"

drawdownTrailCeiling
number

For trailing drawdowns: the floor stops climbing once it reaches initialBalance + this many dollars and locks there (the "ceiling"). Example: 100 on a $0 sim funded locks the floor at +$100 once equity has peaked $1,100. null/absent = the floor trails forever.

Required range: 0 <= x <= 100000000
Example:

100

newsTradingAllowed
boolean

Display-only permission flag shown to traders: trading during news events (default true). Not engine-enforced.

Example:

true

microscalpingAllowed
boolean

Display-only permission flag shown to traders: microscalping (default true). Not engine-enforced.

Example:

true

weekendHoldingAllowed
boolean

Display-only permission flag shown to traders: holding positions over the weekend (default true). Not engine-enforced.

Example:

true

overnightHoldingAllowed
boolean

Display-only permission flag shown to traders: holding positions overnight (default true). Not engine-enforced.

Example:

true

consistency
integer

New consistency requirement (% — see consistency notes)

Required range: 0 <= x <= 100
consistencyEnforced
boolean

Opt-in enforcement switch. false (default) = consistency % is informational only. true = the engine gates evaluation completion (evaluation accounts) or payout eligibility (sim_funded accounts) on the consistency rule.

Example:

true

consistencyBase
enum<string>

What the consistency % applies to. null (default) = automatic by account type: evaluation → max_target_or_pnl (cap grows once total PnL exceeds the target), sim_funded → cycle_profit (profit since the last consistency reset). max_profit_target_or_pnl is accepted as an alias of max_target_or_pnl.

Available options:
max_target_or_pnl,
max_profit_target_or_pnl,
total_pnl,
profit_target,
cycle_profit
Example:

"max_target_or_pnl"

consistencyTolerancePct
number

Daily-cap buffer as a percent of starting balance, added on top of base × consistency%. Example: 0.2 = $100 buffer on a $50,000 account.

Required range: x >= 0
Example:

0.2

consistencyLeniency
number

Flat dollar buffer added to the daily cap (e.g. 40 = $40 leniency on funded payout consistency).

Required range: x >= 0
Example:

40

consistencyMinDays
integer

Minimum profitable days required to pass an evaluation. null (default) = automatic ceil(100 / consistency), e.g. 50% → 2 days, 40% → 3 days. 0 = disabled.

Required range: x >= 0
Example:

2

consistencyProfitableDayMin
number

A trading day counts as profitable when its net PnL is at least this many dollars. Default 0 (any non-negative traded day counts).

Required range: x >= 0
Example:

0

maxPayouts
integer

When set, the Nth processed payout fires the account.max_payouts_reached webhook (e.g. "trader goes live after 5 payouts"). null = unlimited.

Required range: x >= 1
Example:

5

payoutMllLockOffset
number

Default loss-floor offset used by payouts requesting move_mll_to_lock: floor = initial balance + offset. Can be overridden per payout with lockBalance.

Required range: x >= 0
Example:

100

maxAccountDays
integer

Hard time limit in calendar days, counted from activation: when the trader redeemed the account's import key, or when the account was created if it was created for the trader (that day is day 1). The clock runs whether or not the account trades, and resets do not restart it. An in-progress account that has not passed by the end of the last day fails with ruleType time_limit_exceeded. 0 or null = no time limit (default).

Required range: 0 <= x <= 3650
Example:

30

timeLimitExtensionDays
integer

One-time extension of maxAccountDays. When an in-progress account reaches the end of its time limit with total profit (open positions included) strictly above timeLimitExtensionMinProgressPct % of profitTarget, it gets this many more calendar days instead of failing, and you receive account.time_limit_extended. Decided once per account, at the end of the time limit; an account that later falls back below the threshold keeps its extension. Has no effect without maxAccountDays and profitTarget. 0 or null = off (default).

Required range: 0 <= x <= 3650
Example:

30

timeLimitExtensionMinProgressPct
integer

Progress required for the time-limit extension, as a whole percent (0-100) of profitTarget. Total profit must be strictly above it: with a $3,000 target and 50, $1,500.01 qualifies and exactly $1,500 does not. 0 = any profit above $0. Default 0.

Required range: 0 <= x <= 100
Example:

50

maxInactiveDays
integer

Consecutive calendar days without a fill after which the account fails with ruleType inactivity. Counted from the last fill, or from the start if the account has none. Holding an open position counts as activity. 0 or null = off (default).

Required range: 0 <= x <= 3650
Example:

10

dailyLossOffThreshold
integer

Switch the daily loss limit off once the account is this many dollars above its starting balance. Judged on the end-of-day balance (closed balance; open positions do not count; payouts and balance adjustments do) at each daily close: at or above starting balance + this amount, dailyLoss is not enforced from the next trading day, and you receive account.daily_loss_limit_off. Has no effect without dailyLoss. Every other rule, including dailyDrawdown, is unchanged. 0 or null = off (default).

Required range: 0 <= x <= 10000000
Example:

500

dailyLossOffMode
enum<string>

What happens after the daily loss limit is switched off. while_above (default): it is back on from the next trading day after an end-of-day balance below the target (account.daily_loss_limit_on). permanent: it stays off until the account is reset. null = while_above.

Available options:
while_above,
permanent
Example:

"while_above"

maxPositionByMarket
object

Per-market position limits in each market's own unit — {"BINANCE": 0.5} is half a Bitcoin, not 500 of anything. A market listed here is measured against this limit instead of maxContracts, so it is never gated twice; markets left out fall back to maxContracts in mini-equivalents. Prefer this over maxContracts for any market whose contract steps fractionally.

Example:
perpMaxLeverage
number

Perpetuals: the largest total open position value, as a multiple of the account balance (2 = positions worth up to twice the balance). Open positions and working orders count; closing orders never do. Capped at the instrument's own maximum. Null = no leverage cap (maxPositionByMarket still applies). Does not affect futures.

Required range: 1 <= x <= 1000
Example:

2

blockedSymbols
string[]

Contract roots that cannot be opened on accounts using this rule set. Use it for plans restricted to certain contracts, e.g. a micros-only plan lists the full-size contracts (ES, NQ, YM, RTY, CL, GC) and leaves MES, MNQ, MYM, M2K, MCL, MGC tradable. Roots are matched exactly, so ES never blocks MES. Only new positions are refused, with error code SYMBOL_BLOCKED_BY_PLAN; closing or reducing an existing position and take-profit / stop-loss exits are always allowed. Replaces the whole list; null or [] clears it so nothing is blocked. Omit to leave it unchanged.

Maximum array length: 100
Pattern: ^[A-Z0-9]{1,12}$
Example:
sessionWindowStart
string

Start of the rule set's trading session (24-hour HH:MM, in sessionWindowTimezone). Send together with sessionWindowEnd; send both as null to remove the session. Outside the session new positions are refused with error code OUTSIDE_TRADING_SESSION; closing or reducing a position and take-profit / stop-loss exits are always allowed. At the session end open positions are closed and working orders cancelled. The market's own hours and your organization's session open delay and close buffer still apply, so trading is allowed only where they overlap.

Pattern: ^([01]\d|2[0-3]):[0-5]\d$
Example:

"09:30"

sessionWindowEnd
string

End of the trading session (24-hour HH:MM). An end earlier than the start is an overnight session, e.g. 18:00 → 02:00.

Pattern: ^([01]\d|2[0-3]):[0-5]\d$
Example:

"16:00"

sessionWindowTimezone
string

IANA time zone of the session times (default America/New_York). Session times follow daylight saving time in this zone.

Maximum string length: 64
Example:

"America/New_York"

maxPositionByProduct
object

Per-product position caps: contract root → the most contracts of that product an account may hold plus work on one side, e.g. {"SIL": 5} = at most 5 micro Silver long or 5 short. Counted in the product's own contracts across every contract month; open positions and working entry orders count, take-profit/stop-loss orders do not. Closing and reducing are always allowed, also on a position above a newly lowered cap. Applies on top of maxContracts / maxPositionByMarket (the stricter limit wins). Orders over the cap are rejected with PRODUCT_LIMIT_BY_PLAN. Roots are matched whole: a cap on SI does not cover SIL. null or {} removes every cap.

Example:
maxContracts
integer

New max contracts limit (mini-equivalent units). A rule is not tied to a market, so this is always counted in ENGINE units: one unit is one futures contract, but 0.001 BTC on the Binance perpetual. A 0.1 BTC cap is therefore 100, and 1 BTC is 1000. Read quantityStep on the contract to convert.

Required range: 0 <= x <= 1000000
microConversionRatio
integer

How many micros count as 1 unit toward maxContracts (null resets to the default 10)

Required range: x >= 1
Example:

5

scalingPlan
object

New scaling plan (replaces existing; null to remove and fall back to maxContracts)

Example:
personalRiskPolicy
object

Replaces the existing personal risk policy in full; null removes it and leaves traders unconstrained.

Example:
metadata
object

New metadata. Replaces existing metadata wholesale unless mergeMetadata is true. At most 16 KB as JSON, 50 top-level keys and 5 levels of nesting; larger metadata returns 400 METADATA_TOO_LARGE.

Example:
mergeMetadata
boolean

When true, the provided metadata keys are merged into the existing metadata instead of replacing it entirely

Example:

true

Response

Rule updated successfully

success
boolean
Example:

true

message
string
Example:

"Trading rule updated successfully"

data
object