Skip to main content

How risk is enforced

Who it’s for
Anyone who is about to deploy a strategy, in paper or live
Assumes
You have a strategy assembled. You do not need to have deployed anything yet.
Applies to
Every deployed strategy, in both paper and live mode

Risk on Stretus is enforced in three places, at three different moments. Understanding which control lives where is what stops you assuming a limit exists when it does not.


Why this page exists first

Most platforms document risk under "deploy", as a thing you configure at the end. That is the wrong place, because the decisions are made earlier. Position sizing is a build-time decision. Drawdown tolerance is a validate-time decision. By the time you are on the deploy screen the shape of your risk is already fixed, and the only thing left is the size of the allocation.

So risk is a section, and it sits between validate and deploy, where the reading order matches the decision order.


The three layers

Build timeValidate timeExecute time
ControlsStop-loss, take-profit and trailing, per-trade risk %, max trades, trading window, daily loss capMax drawdown, drawdown recovery time, consistency and sample size, cost-adjusted return, grade thresholdsNine order gates, cooldown after loss, trading window, margin validation, capital ceiling
What the layer doesWritten into the strategy objectMeasured, not enforcedEvaluated on every order, before placement

Layer 1: build time: the rules inside the strategy

When the AI assembles a strategy it writes risk controls into the strategy object itself: the stop-loss, the take-profit or trailing take-profit ladder, per-trade risk percentage, maximum trades, and the trading window. These are part of the strategy's definition. They are what the backtest simulates and what the live engine reads.

Set these by saying what you want: "1.5% stop, risk 1% per trade, no more than 3 trades a day". See Risk management in the builder.

Layer 2: validate time: measurement, not enforcement

The backtest measures the consequences of your layer-1 choices. Max drawdown, recovery time, profit factor, sample size. Nothing here blocks anything. It tells you what your rules did on past data so you can change them before they run on live capital.

The important distinction: a backtest showing an 11% max drawdown is not a promise of an 11% ceiling. It is the worst thing that happened in that window. See Backtest limitations.

Layer 3: execute time: the order gates

This is the layer most users do not know exists. Every order a deployed strategy tries to place is evaluated against a pipeline of nine risk validators before it reaches the broker. Each one either passes the order or blocks it with a named reason and a recorded violation.

Evaluation order is deliberate, cheapest and most decisive checks first, so an order that fails on shape never costs a metrics read:

OrderGateWhat it checks
1max_order_valueThis order's notional against a ceiling
2per_trade_riskStop-distance × quantity against a percent of allocation
3max_open_positionsConcurrent open entries
4max_trades_per_dayNew entries opened today
5max_consecutive_lossesLosing round-trips in a row
6daily_loss_limitToday's realised loss against a percent of allocation
7mark_to_market_lossRealised plus unrealised loss against an absolute amount
8max_capital_allocationTotal deployed capital including this order
9available_capitalWhether the strategy can fund this order at all

Plus three controls that sit alongside the pipeline: a cooldown after a losing streak, a trading-window check, and margin validation for margined instruments.

Full reference with units, defaults and trip behaviour: The nine order gates.


The thing you must know before deploying

A limit you did not set is not a limit

Seven of the nine gates are disabled until you configure a value. A zero value means the rule does not run. There is no implicit default, no platform-wide fallback, and no warning that a limit is absent.

Two gates cannot be disabled: max_capital_allocation against your allocation, and available_capital. Those two are why a strategy can never exceed the capital you gave it. Everything else is opt-in.

The configuration parser is also deliberately fail-open: a malformed risk configuration yields no enforced rules rather than blocking trading. That is the right choice for availability, a bad payload should never hard-block a strategy trying to exit, and it means a configuration you thought you set may not be in force. Verify your limits on the strategy's risk panel rather than assuming.

Which gates are on, which are off, and what to set them to: Which limits are on by default.


What the gates do and do not do

The gates doThe gates do not
Block a new order that breaches a limitClose an open position
Report the rule, the current value and the limitAct between candle evaluations
Always allow exits, even at a limitPrevent a gap through your stop
Record a violation you can seeRecover capital already lost

The asymmetry is the design: entries are gated, exits are not. A strategy sitting at its max_open_positions cap must still be able to close a position to release a slot. A gate that blocked exits would trap capital in exactly the situations the gate exists to protect against.

The corollary is that a breached daily-loss cap stops new trades and leaves the open position running to its own stop. If you need to be flat, close the position at your broker.


Paper and live are gated identically

The risk pipeline runs the same way in paper as in live. That is what makes paper a real test of your configuration rather than a test of the strategy alone, a paper run that trips your daily-loss cap has told you something true about your limits.


Where to go next

PageWhat it gives you
The nine order gatesEvery gate: unit, default, what trips it, what happens
Which limits are on by defaultThe on/off table and a recommended starting configuration
Alerts & breachesWhat you see when a gate trips, and how to resume
Risk management in the builderSetting layer-1 controls in plain language
Position sizingHow per-trade risk becomes a quantity