VIZANIXTrading Software Development
Markets and AIRisk6 min read

Put the model in the risk engine, not in the signal

Everyone wants AI to decide what to buy. The higher-value and lower-risk application is having it decide when to stop.

Vizanix engineering · about the author

ARTICLE
6 minreading time
SECTION
Markets and AI
PUBLISHED
2026-08-29
CHAPTERS
4
READ NEXT
3
LANGUAGE
written in English
An engineering breakdown, not a rewrite of the docs.
RISKANOMALYREGIMESIZINGGUARDRAILS

The default assumption is that a model's job is to find opportunities. It is worth considering the inverse, because the economics are better and the failure mode is milder.

A signal model that is wrong loses money. A risk model that is wrong sizes down when it did not need to — the cost is opportunity, which is recoverable.

Three applications that pay

Regime classification. Most strategies work in some conditions and not others, and most operators know which but cannot state it precisely. A classifier over volatility, liquidity, correlation structure and funding can output a regime label that scales exposure — full size in the regime the strategy was validated in, reduced or zero elsewhere.

Liquidity-aware sizing. Position size normally comes from volatility and the stop. Book depth is the missing input: the same volatility in a thin book means far worse slippage on exit. A model predicting realised slippage from book state, trade size and recent flow lets sizing respond to how expensive it will be to leave.

Anomaly detection on your own behaviour. Train on the bot's normal operating envelope — fill rates, latency, reject codes, prediction distribution, time between signals — and alarm on deviation. This catches a broken bot faster than any P&L-based check, and it does not need to know anything about markets.

Why the economics are better

Model in the signalModel in the risk layer
Wrong prediction costsMoneyOpportunity
Needs to beat the marketYesNo — only needs to beat a constant
Decays when others find itYesLargely no
Baseline to beatZero edgeFixed sizing rules
Failure is visibleEventually, in P&LImmediately, in exposure

That second row is the important one. A signal model has to be better than the market's collective opinion, which is a high bar. A risk model only has to be better than a constant — “always risk 1%” — which is a much easier target and rarely optimal.

Hard limits stay hard

A model in the risk layer is allowed to be more conservative than the rules. It is never allowed to be less.

python
def final_size(intent, model, limits):
    base = limits.max_size_for(intent.symbol)
    scaled = base * model.exposure_multiplier(state)   # in [0, 1] — only reduces
    # Hard limits are floors on caution, not suggestions the model can argue with.
    return min(scaled, limits.hard_cap(intent.symbol), limits.remaining_daily_budget())

The reason is that a model can be confidently wrong, and the situations in which it is most likely to be confidently wrong are unfamiliar regimes — which are exactly the situations where hard limits matter. A risk model that can raise a limit has removed the protection it was meant to add.

Start with the cheapest version

You do not need a model to get most of this. Ordered by value per hour spent:

  1. A volatility-scaled position size. No model, large improvement over fixed sizing.
  2. A liquidity term that reduces size when the book thins. Still no model.
  3. A crude regime label — high/normal/low volatility — with different size multipliers.
  4. A statistical anomaly check on the bot's own operating metrics.
  5. Only then, a learned model for any of the above.

In our experience steps one to four capture most of the benefit, and the fifth is worth doing only once the first four are in place and instrumented. A learned risk model on top of no risk discipline is decoration.

This article describes engineering practice. It is not investment advice. Vizanix develops software and does not promise trading returns.

Blog

Read next

Want this running for you?

We write about what we build. If you need it built, get in touch — scoping is free.

Brief

Get a project estimate

Four questions and your contact. No deposit required to talk — if the job is not a fit, we say so straight away.

01What do you need
02Exchange
03Market
04Strategy
05Contacts

Prefer to write directly? Telegram @vx_ceo

Discuss a system