Skip to main content
POST
Create a new 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

Body

application/json
name
string
required

Rule name (must be unique within your organization)

Maximum string length: 200
Example:

"Aggressive 100K Challenge"

description
string

Rule description

Maximum string length: 2000
Example:

"High risk tolerance rules for experienced traders"

profitTarget
integer

Profit target to pass ($)

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

10000

dailyProfit
integer

Max daily profit cap (0 = unlimited)

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

0

dailyProfitEnforced
boolean

Engine enforces dailyProfit: on reaching it the account is flattened and locked until the next trading day (default false, informational only)

Example:

false

bestDayStopPct
integer

Best-day stop: once the day's P&L, open positions included, is above this percent of profitTarget, the account is flattened and locked until the next trading day, without failing it. Landing exactly on it is allowed (40 with a $3,000 target: $1,200 is fine, $1,200.01 stops). Checked continuously. Requires profitTarget > 0. 0 = off (default)

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

0

maxProfit
integer

Max total profit cap (0 = unlimited)

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

0

dailyLossEntryBufferTicks
integer

Daily-loss entry buffer: refuse a new entry when the room left under dailyLoss does not cover the order's round-trip fees plus this many ticks per contract, so the auto-close cannot land far past the limit straight after entry. Exits are never refused. Requires dailyLoss > 0. 0 = off (default): entries are allowed until the limit is breached

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

0

dailyLoss
integer

Max loss allowed per day ($)

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

2500

maxLoss
integer

Max total loss from starting balance ($)

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

5000

dailyDrawdown
integer

Max daily loss as a whole-number percent of the day's starting balance (2 = 2%), open P&L included. 0 = off

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

2

maxDrawdown
integer

Max drawdown from the reference. Percent of the reference by default (must be <= 100); a fixed dollar amount when drawdownDenomination is "dollars".

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

5

drawdownType
enum<string>
default:static

How drawdown is calculated. "static" = fixed from initial balance. "trailing" = real-time from high water mark. "eod" = trailing but only updates at end of day.

Available options:
static,
trailing,
eod
Example:

"trailing"

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

Consistency rule % — max share of profit any single day may reach (0 = disabled). See the consistency notes for the full formula and companion fields.

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

30

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. Omit, send null or send [] to block nothing.

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

Max position size in mini-equivalent contracts (micros converted via microConversionRatio). 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
Example:

10

microConversionRatio
integer

How many micro contracts (MES, MNQ, ...) count as 1 unit toward maxContracts. Default 10 (CME notional ratio). Use 5 for 5-micros-per-mini plans, or 1 to count micros the same as minis.

Required range: x >= 1
Example:

10

scalingPlan
object

Profit-based contract scaling tiers. Overrides maxContracts when set (see notes).

Example:
personalRiskPolicy
object

Bounds on the risk controls traders set for themselves on accounts using this rule set (see notes). Omit to leave traders unconstrained.

Example:
metadata
object

Custom metadata for your organization. At most 16 KB as JSON, 50 top-level keys and 5 levels of nesting; larger metadata returns 400 METADATA_TOO_LARGE.

Example:

Response

Rule created successfully

success
boolean
Example:

true

message
string
Example:

"Trading rule created successfully"

data
object
Example: