AlgoTradingAI

Risk Controls

How AlgoTradingAI Manages Risk

Every signal generated by the platform includes risk context. Stop-loss levels, position limits, and quality gates are configurable — not hidden. You control the parameters.

Stage 1 — Signal Only: AlgoTradingAI does not execute trades. All risk controls apply to signal generation and the Paper Trading Playground. When live execution is added in Stage 2, additional controls (kill switch, max daily loss, circuit breakers) will be implemented.

Active Risk Controls

These controls are live in the current version of the platform.

Configurable Stop-Loss Engine

Every signal includes a recommended stop-loss computed by a central risk module. Supports percent-of-entry, ATR-multiple, and absolute-price modes. Values are loaded from risk.yaml — not hardcoded.

Position Sizing Limits

Maximum position size per trade is configurable by instrument type (equity vs option) and trade type (intraday vs swing). Prevents oversized exposure on any single idea.

Symbol Limits by Plan

Each subscription tier has a maximum number of active symbols. Free: 2, Starter: 5, Intermediate: 10, Pro: 50, Pro+: unlimited. Limits are enforced server-side.

Intraday Square-Off Check

The worker service runs periodic checks during market hours to flag paper playground holdings that should be squared off before market close for intraday positions.

Duplicate Signal Prevention

The signal engine deduplicates: if an active signal already exists for a symbol + direction + strategy combination, a new signal is not generated until the prior one exits.

API Disconnect Handling

When Kite API becomes unavailable (token expiry, network issue), the system falls back to Redis-cached candle data (7-day TTL). Features like forecasting and advisory continue to function with cached data.

Admin Broker Proxy Isolation

Users without their own broker connection receive market data through an admin proxy with strict operation whitelisting (candles, quotes, instruments only). Admin credentials are never exposed to end users.

Rate Limiting

Public API endpoints are rate-limited per client IP. Authenticated endpoints respect per-user rate limits to prevent abuse and ensure fair resource allocation.

ML Quality Gate

The ML prediction layer acts as a quality filter — only candidate trades scoring above a configurable confidence threshold (default 0.6) are surfaced as signals. ML cannot override stop-loss or position limits.

Strategy-Level vs Account-Level

Risk parameters can be configured at two levels: per-strategy (in strategies.yaml) and per-account (in risk.yaml). Account-level limits always take precedence as a hard cap.

Planned for Stage 2 (Live Execution)

The following controls will be implemented when automated order execution is enabled.

Kill Switch

One-click emergency stop that cancels all pending orders and prevents new order submission until manually re-enabled.

Max Daily Loss

Configurable daily loss threshold. When hit, all execution is halted for the remainder of the trading session.

Max Drawdown

Account-level drawdown limit that triggers automatic position flattening when breached.

Circuit Breakers

Automatic pause on signal generation if market conditions trigger exchange-level circuit breakers or abnormal volatility.