Pre-Trade Risk System
Nanoconda provides a Pre-Trade Risk System that checks every order against the account's risk limits before it is sent to the exchange.
Risk checks run in memory inside the Nanoconda trading engine, with no separate risk server and no extra network hop. Every new order and every modification is checked against the account's live positions, working orders and orders in flight.
The same controls apply to C++ algorithms, the Real-Time GUI, FIX, Sierra Chart and other network clients. An order that fails a risk check is not sent to the exchange, and the application receives a reason code.
The FCM has its own clearer role. From the GUI or the Remote API, the FCM can monitor positions, orders and P&L in real time, change risk limits during the session, disable trading for the account, cancel all orders and flatten positions.
System Scope
| Function | Description |
|---|---|
| Pre-trade enforcement | All new orders and order modifications are validated prior to exchange submission |
| Order state management | Maintains real-time order state per session |
| Order actions | Supports order submission, cancellation, and modification |
| Trading control (Kill Switch) | Allows trading to be enabled or disabled per account or for algorithms |
| Clearing firm access | Dedicated clearer role to monitor accounts, change limits and stop trading |
Pre-Trade Risk Checks
Risk limits are set per underlying asset (for example ES) and apply to all contracts of that asset. Spread orders are counted per leg.
| Risk Check | Description | Notes |
|---|---|---|
| Asset net exposure | Prevents orders that would exceed configured net exposure limits, including working and in-flight orders | Config: maxpositions |
| Clip size | Restricts maximum quantity per order | Config: clipsize |
| Price bands | Rejects orders and stop triggers priced outside the exchange price limits | From exchange data, no configuration |
| Tick size | Rejects prices that are not a multiple of the instrument tick size | From exchange data, no configuration |
| Maximum loss | Once session losses reach the limit, only orders that reduce the position are accepted | Config: max-drawdown |
| Maximum daily lots | Limits total number of daily lots traded; once reached, only orders that reduce the position are accepted | Config: maxdailylots |
| Capital usage | Prevents orders that would cause total capital usage to exceed the account balance | Config: capitalreq, starting-balance, enforce-capital-requirements |
| Throttle limits | Limits order action submission rate, with a separate allowance for cancels | Config: throttle-limit, throttle-window |
| Account trading status | Blocks orders when trading is disabled for the account | GUI or Remote API |
| Algo trading status | Blocks automated orders when algo trading is disabled | GUI or API |
| Session status | Blocks orders while the exchange session is disconnected | Automatic |
| Unconfigured assets | Rejects orders for assets without configured risk limits | <Instrument> per asset |
Capital Usage
Capital usage is calculated using the configured capitalreq value for each asset and applied to its net exposure (current net position plus working orders).
Before accepting a new order, Nanoconda calculates the projected total capital usage across all assets, including the new order. If the projected capital usage exceeds the configured account balance, the order is rejected by the pre-trade risk engine with code RISK_CAPITAL_USE_EXCEEDED
Configuration
Session-level controls are attributes of the <Access> node; per-asset limits are set in the <Risk> node. See CME iLink 3.0 configuration.
<Access ...
max-drawdown="5000"
starting-balance="100000"
enforce-capital-requirements="true"
throttle-limit="100"
throttle-window="1">
<Risk>
<Instrument symbol="ES" maxpositions="20" clipsize="5" maxdailylots="500" capitalreq="15000" />
<Instrument symbol="NQ" maxpositions="10" clipsize="2" maxdailylots="200" capitalreq="20000" />
</Risk>
</Access>
Order Rejections
| Condition | Behavior |
|---|---|
| Risk check failure | Order is rejected |
| Exchange transmission | Order is not sent |
| Feedback | Rejection reason code reported to the session |
| Risk Check | Reason Code |
|---|---|
| Asset net exposure | RISK_LIMIT_EXCEEDED |
| Clip size | RISK_CLIP_SIZE_EXCEEDED |
| Price bands | PRICE_BAND_BREACHED |
| Tick size | TICK_SIZE_ERROR |
| Maximum loss | RISK_MAX_LOSS_EXCEEDED |
| Maximum daily lots | RISK_DAILY_LOTS_EXCEEDED |
| Capital usage | RISK_CAPITAL_USE_EXCEEDED |
| Throttle limits | REQUEST_LIMIT |
| Account trading disabled | PERMISSION_ERROR |
| Algo trading disabled | ALGO_BLOCKED |
| Session disconnected | SESSION_DOWN |
| Unconfigured asset | RISK_NOT_SET |
Kill Switch and Clearing Controls
| Control | Description |
|---|---|
| Disable / enable trading | Stops all new orders and modifications for the account |
| Block / allow algos | Stops automated orders while manual trading remains available |
| Cancel all orders | Cancels all working orders |
| Flatten | Cancels working orders and closes open positions |
| Risk-reducing actions | Cancels and cancel all remain available while trading is disabled; flatten from the GUI or Remote API also remains available |
Real-Time Risk Adjustments
| Capability | Description |
|---|---|
| Parameter updates | Per-asset limits (maxpositions, clipsize, maxdailylots, capitalreq) may be updated in real time |
| Effect | Updates apply immediately to new orders |
| Authorization | Available to role: clearer |
| Monitoring | Positions, working orders, fills, P&L and capital usage are visible in real time |
Operation
Real-time monitoring and control of the Pre-Trade Risk System is performed through the GUI or C++ Remote API
See GUI Clearing Controls for details.
Ways to View and Manage Risk
| Interface | View | Manage |
|---|---|---|
| Session configuration (XML) | Sets session and per-asset limits at session start. Limits changed in real time are kept across restarts with persist-risk="true" |
|
| Nanoconda CLI | resetrisk restores the limits from the session configuration |
|
| Real-Time GUI | Account summary, positions, working orders, trade log, risk limits and usage | Change limits, disable / enable trading, block / allow algos, cancel all, flatten |
| Remote API (C++) | getRiskLimits, sessionPnl, maxDrawdown, capitalUse, accountBalance, sessionStatus, trade log |
setRiskLimits, disableTrading / enableTrading, blockProgram / allowProgram, cancelAllOrders, flatten |
| Order Entry API (C++) | Trading programs read getRiskLimits, sessionPnl, maxDrawdown, accountBalance |
Cannot change risk limits; every refused order returns its reason code |
| FIX | Drop copy of all account orders, fills, positions and risk rejects (OrdRejReason) |
Risk limits are not available over FIX |
| Sierra Chart (DTC) | Positions, account balance and reject reasons |
Actions available to each login depend on its role; see Configuring Users and Roles.