Alerts & breaches
A gate tripping is not an error. It is the system doing what you configured it to do. This page covers what you see when it happens, how to tell which gate it was, and how trading resumes.
What a breach looks like
When a validator blocks an order, it produces a violation carrying four things:
| Field | Example |
|---|---|
| Rule | daily_loss_limit |
| Reason code | DAILY_LOSS_LIMIT_EXCEEDED |
| Current value | -3,180.00 |
| Limit | -3,000.00 |
That shape is deliberate: you can always answer "which rule, and by how much" without inference. The message states both figures in the strategy's quote currency.
Violations appear on the strategy's risk panel and in its event timeline. If you have Telegram notifications enabled, they arrive there too. See Notifications.
The symptom you will actually notice
A gated strategy looks like a strategy that has stopped taking new trades while its open position continues. That is correct behaviour and it is worth recognising, because the instinct is to assume the strategy has broken.
If a running strategy is not entering:
- Check the risk panel for an active violation. This resolves it most of the time.
- If there is no violation, check the trading window, the strategy may simply be outside its allowed hours.
- If the window is open and there is no violation, check whether the entry condition is actually true. A strategy with no signal is not a strategy with a problem.
How each gate clears
The distinction that matters: some gates clear by themselves, some clear when the day rolls, and some need you to act.
| Gate | Clears when |
|---|---|
max_order_value | The next signal produces a smaller order, nothing to clear |
per_trade_risk | The next entry's stop distance × quantity fits the budget |
max_open_positions | A position closes, freeing a slot |
max_trades_per_day | UTC midnight |
max_consecutive_losses | The cooldown elapses, or a winning round-trip resets the streak |
daily_loss_limit | UTC midnight, or the day's realised P&L improves above the cap |
mark_to_market_loss | Realised + unrealised recovers above the limit |
max_capital_allocation | Deployed capital falls, a position closes |
available_capital | Capital frees up, or you increase the allocation |
The daily counters roll at 00:00 UTC. For an Indian equity strategy that is 05:30 IST, inside the overnight gap, not at the 09:15 session open. A strategy that hit its daily loss cap at 14:00 IST resumes the following morning; one that hit it at 05:00 IST resumes half an hour later, mid-gap.
Cooldown
The consecutive-loss gate would otherwise deadlock: it blocks entries until a win, and a win cannot happen while entries are blocked. The cooldown resolves that by time-boxing the halt.
| Configured as | gates.cooldown_bars_after_loss |
| Unit | Bars at the strategy's own timeframe |
| Default when unset | 3 bars |
| Resumes at | Last losing exit + (bars × timeframe) |
A 5-minute strategy with the default sits out 15 minutes after tripping the streak cap. A daily strategy sits out three days.
Cooldown state is computed on every evaluation, never persisted. There is no stored pause to clear, no stuck state to reset, and restarting a strategy does not skip a cooldown that has not elapsed.
Resuming manually
Some situations you resolve yourself rather than waiting:
| Situation | What to do |
|---|---|
| The limit was set too tight for how the strategy actually trades | Raise the limit. It takes effect on the next order |
| The strategy is out of capital because positions are open | Wait for exits, or increase the allocation |
| The strategy is losing and you want it stopped | Stop it, and close the open position at your broker, because stopping does not flatten |
| A market order keeps skipping the mark-to-market gate | That gate needs a price on the order. A market order with no price hint cannot be evaluated |
A gate tripping is information. Before you raise the limit, ask whether the limit was wrong or whether the strategy is behaving worse than you expected. Raising a daily loss cap because you hit it is how a bad day becomes a bad week.
What a breach does not do
| It does not | Because |
|---|---|
| Close your open position | Gates block entries only. Blocking exits would trap capital |
| Cancel working orders | Existing orders are not withdrawn by a later violation |
| Pause the strategy permanently | Every gate has a clearing condition |
| Unwind anything at the broker | Stretus does not force-flatten from a risk gate |
If a position needs to be closed, close it. The risk system's job is to stop the next order, not to unwind the last one.
Failure modes worth knowing
A gate that cannot evaluate skips. per_trade_risk skips when there is no stop price.
mark_to_market_loss skips when a market order carries no usable mark. daily_loss_limit skips
when allocated capital is unknown. In each case the gate declines to guess, which is right, and
also means the protection is absent for that order.
A malformed configuration disables everything. The parser fails open. See Which limits are on by default.
Gaps do not respect gates. No gate acts between candle evaluations. A market that moves through your stop overnight has already moved.
Next
- Which limits are on by default
- Monitoring, where to watch a running strategy
- Notifications, getting breach alerts on Telegram