Algorithmic Trading Risk Management: The 14-Check Gate Explained
The difference between a trading bot that survives a rough year and one that blows up rarely comes down to strategy quality. It's almost always risk management. This post is a practical tour of the fourteen checks that should run against every order your bot wants to send, with concrete thresholds you can copy.
Why 14?
Fourteen isn't magic. It's the number of independently motivated failure modes we've seen real trading bots hit. Each check guards against a specific way to lose money that has happened in production somewhere. They cluster into four groups:
- Universe checks (2) — is this symbol allowed?
- Position-level checks (3) — is this single order sized correctly?
- Portfolio-level checks (6) — is the portfolio still healthy?
- Market-quality checks (3) — is the market in a tradeable state?
Universe checks
1. Symbol blacklist
Don't trade names you've pre-decided are too unpredictable. Ours ships with GME, AMC, BBBY blocked by default — you can extend the list. The point is not to predict the next meme; it's to pre-commit to not trading certain names when the model inevitably thinks they look interesting.
2. Signal confidence floor
Reject any signal below a minimum confidence threshold (we default to 0.70 for rule strategies, 0.75 for AI). This is the cheapest risk check and the one most bots skip.
Position-level checks
3. Max position size (% of equity)
No single position should be more than X% of total equity. A common sweet spot: 10%. Lower if you trade illiquid names; higher only if you have a specific reason.
4. Max single-trade loss (% of equity)
Even if you're comfortable with a 10% position, the stop-loss shouldn't risk more than 1-2% of equity on any single trade. If stop = 2×ATR and ATR is 3% of price, a 10% position risks 0.6% on that trade. Make sure the math works out.
5. Minimum cash reserve
Always keep 10% of equity in cash. This gives you room to handle margin calls, cover slippage, and fund the next high-conviction setup. Aggressively-levered bots skip this at their peril.
Portfolio-level checks
6. Max open positions
Cap concurrent positions. Defaults we like: 15. More than that and you're probably not actually running 15 conviction trades — you're indexing. Different product, different risk profile.
7. Max daily trades
Sanity cap on turnover. If your bot wants to make 100 trades today, something is broken. Default: 50.
8. Max daily loss (%)
Halt trading if daily P&L drops below -3%. Live to fight tomorrow. This is the single most important rule in the list.
9. Max weekly loss (%)
Same idea at a weekly resolution: -7% and you're done for the week. Forces you to step back and diagnose before revenge trading.
10. Max drawdown (%)
Peak-to-trough equity drop ceiling. 15% is a conservative default. Hit it and the circuit breaker fires; the bot goes quiet until you manually clear it.
11. Sector allocation cap (%)
No more than 30% of portfolio in a single sector. Stops you from accidentally running "all tech, all the time".
12. Correlated exposure cap (%)
Group symbols by correlation cluster (e.g. "crypto beta" = BTC + ETH + SOL + major alts). Cap total exposure to any cluster at 40%. Sector limits aren't enough because crypto across exchanges has no traditional sector.
Market-quality checks
13. Minimum volume
Reject orders in names with daily volume below a threshold (100k shares by default for stocks). You don't want to be the liquidity.
14. Maximum spread
Reject orders when bid-ask spread exceeds 2%. Wide spreads mean you'll lose your edge on transaction cost. More important than people realise — many backtests assume zero spread and get humbled by reality.
The 7-trigger circuit breaker
The 14 checks block individual trades. The circuit breaker is the escalation: it halts all trading. Our seven triggers:
- 5 consecutive losing trades
- -3% day-over-day P&L
- -7% week-over-week P&L
- Max drawdown breached (-15%)
- VIX closes above 35
- 3+ system errors in 5 minutes (data feed issue, broker rejects, etc.)
- Manual kill switch from the dashboard
Any one of these halts new order placement. Existing positions still stream their own stops and take-profits through the broker. See the circuit breaker guide for the full behaviour.
Common pitfalls
Short-circuit evaluation
Some bots stop checking as soon as one check fails, so the rejection reason in the audit log only names the first failure. That's fine for execution efficiency but it makes post-incident reviews harder. Run all 14 checks every time; the cost is negligible.
Model-suggested stops
If you use an AI strategy, the LLM will happily suggest a stop on the wrong side of the entry price. Validate before accepting: stop below entry for BUY, above entry for SELL. If invalid, null it and let the risk manager pick an ATR-based default.
Risk overrides
No override flag. Not even for you. The most expensive bugs we've seen were manual overrides that became habitual. Make the risk gate mandatory in code; if you need to skip it, change the parameters, don't bypass the gate.
Implementing this
In KlawTrade, all 14 checks are first-class config:
risk:
max_portfolio_allocation: 0.90
max_single_position_pct: 0.10
max_sector_allocation_pct: 0.30
max_correlated_exposure_pct: 0.40
max_daily_loss_pct: 0.03
max_weekly_loss_pct: 0.07
max_drawdown_pct: 0.15
max_single_trade_loss_pct: 0.02
max_open_positions: 15
max_daily_trades: 50
min_cash_reserve_pct: 0.10
order_guards:
min_volume_threshold: 100000
max_spread_pct: 0.02
blacklisted_symbols: ["GME", "AMC", "BBBY"]
circuit_breaker:
consecutive_losses_halt: 5
halt_duration_minutes: 60
vix_threshold: 35