Risk Management
How bot-level risk limits and strategy exit rules work together to protect your capital.
Three Layers of Protection
plutarc applies risk controls at three independent layers, each serving a different purpose:
Strategy Exit Rules
Exit rules are part of your strategy template. They define when to close a specific position based on market conditions — hard stop losses, take profit targets, trailing stops, break-even stops, chandelier exits, volatility exits, time stops, and signal flip exits. Multiple exit rules can be active simultaneously, and any triggered rule closes the position.
Strategy Risk Gates
Risk gates are strategy-level components that block entries based on market risk conditions. They run after signals are evaluated but before a trade is opened — so you can see what the strategy would have done while still blocking risky entries. Components like Funding Rate, ATR, Volume Spike, and Volatility Regime Classifier can serve as risk gates, blocking entries when funding is extreme, volatility is too low, or volume is too thin.
Bot-Level Risk Limits
Risk limits are configured per bot and act as hard safety guardrails that override strategy decisions. Even if your strategy signals an entry, the bot will block it if a risk limit would be violated. Risk limits protect against scenarios your strategy may not anticipate — runaway losses, excessive exposure, or execution problems.
Think of exit rules as tactical (managing individual trades), risk gates as conditional (blocking entries in risky markets), and risk limits as strategic (protecting the overall account). All three layers are always active.
Position Limits
Max Positions per Asset
The maximum number of simultaneous open positions allowed on a single trading instrument. This prevents over-concentration on one symbol. When the limit is reached, new entries for that asset are blocked until an existing position is closed.
Max Positions Total
The maximum number of simultaneous open positions across all instruments. This caps overall exposure. When the limit is reached, no new positions can be opened on any asset until an existing one is closed.
Loss Limits
Max Per-Trade Loss
The maximum loss allowed on a single trade, expressed as a percentage of equity. If a position's unrealised loss exceeds this threshold, the bot closes it immediately — regardless of what the strategy's exit rules say. This acts as an emergency stop loss that catches cases where strategy-level stops may not trigger (e.g. due to gaps or extreme volatility).
Daily Loss Limit (Kill Switch)
The maximum cumulative loss allowed in a single trading day, expressed as a percentage of equity. When triggered, the bot closes all open positions and halts trading until the next trading day. This prevents a series of losing trades from compounding into catastrophic drawdown.
Consecutive Loss Pause
The number of consecutive losing trades after which the bot automatically pauses new entries. When triggered, the bot enters a cooldown period (configurable duration) during which it manages existing positions but does not open new ones. This helps break losing streaks and prevents emotional or momentum-driven overtrading.
Execution Safety
Max Leverage
The maximum leverage the bot is allowed to use when opening positions. This overrides any higher leverage configured on the exchange side. Setting a conservative max leverage reduces liquidation risk and limits the impact of adverse price moves.
Max Slippage
The maximum acceptable slippage (in basis points) between the expected price and the fill price. If an order fills at a price worse than this threshold, the bot logs a warning. This helps detect deteriorating liquidity conditions or exchange issues.
API Error Threshold
The number of consecutive API errors allowed before the bot automatically pauses trading. This protects against scenarios where the exchange API is degraded — the bot stops placing orders rather than operating with unreliable connectivity.
How Exit Rules & Risk Limits Interact
Exit rules and risk limits are evaluated independently and both are always active. The key difference is scope and priority:
- Exit rules act on individual positions — they evaluate market conditions (price relative to stop level, ATR, time held) and close the position when their condition is met.
- Risk limits act on the bot as a whole — they can block new entries (position limits), force-close positions (per-trade loss), halt all trading (daily kill switch), or pause entries (consecutive loss).
- Risk limits always win — if a strategy signals an entry but a risk limit says no, the entry is blocked. If the daily kill switch triggers, all positions are closed even if no exit rule has fired.
Example Scenarios
Scenario: Flash crash
A sudden price drop gaps through your strategy's hard stop loss level. The per-trade loss limit catches the position at the next available price once the loss exceeds the configured percentage, limiting damage beyond what the stop loss could prevent.
Scenario: Choppy market
Your strategy enters and exits repeatedly in a ranging market, accumulating small losses. After the configured number of consecutive losses, the consecutive loss pause halts new entries for the cooldown period, giving the market time to develop a clearer trend.
Scenario: News-driven volatility
An unexpected event causes losses across multiple positions. The daily loss kill switch triggers when cumulative losses hit the threshold, closing all positions and preventing further exposure until the next trading day.
Scenario: Exchange API issues
The exchange API starts returning errors intermittently. After the configured number of consecutive failures, the API error threshold pauses the bot to avoid placing orders that may not execute correctly or that the bot cannot track.
Best Practices
- Always configure both layers. Strategy exit rules handle normal trade management; bot risk limits catch the edge cases your strategy does not anticipate.
- Set the daily loss limit conservatively. A common starting point is 3-5% of equity. This ensures a single bad day cannot significantly damage your account.
- Use the max leverage limit. Even if you configure higher leverage on the exchange, capping it at the bot level prevents accidental over-leveraging during template changes.
- Backtest before deploying. Review the maximum drawdown and worst-case trade in backtest results. Set your risk limits to survive those scenarios with margin to spare.
- Review risk limits periodically. As your equity changes, fixed-percentage limits may need adjusting. What was conservative at launch may become too loose or too tight as the account grows or shrinks.