Risk Management
Risk management is not optional – it is the single most important part of any live trading setup. A strategy with an edge can still destroy an account if position sizes are too large, losses are allowed to compound, or a technical glitch causes runaway order submission. Stratifyre’s risk management system provides multiple layers of protection that operate independently of your strategy logic, ensuring that no single failure can lead to catastrophic loss.
Why risk management matters
Section titled “Why risk management matters”Even the best strategies experience drawdowns. Markets can gap, liquidity can evaporate, and unexpected events can move prices in ways no backtest predicted. Risk management controls exist to ensure that when bad things happen – and they will eventually happen – the damage is contained and recoverable.
Consider these scenarios:
- A flash crash drops prices 5% in seconds. Without position limits, your strategy might be fully invested when it happens.
- A strategy bug causes orders to fire in a loop. Without rate limiting, hundreds of orders could be submitted before you notice.
- A prolonged losing streak drains your account. Without drawdown limits, the strategy keeps trading until there is nothing left.
Stratifyre’s risk controls are designed to catch all of these scenarios and more, automatically and without human intervention.
Position limits
Section titled “Position limits”Position limits control how much capital can be allocated to any single position, preventing overconcentration in one instrument.
Maximum shares
Section titled “Maximum shares”Set the maximum number of shares (or contracts) that can be held in any single position. If a strategy signal calls for more shares than the limit allows, the order will be reduced to the maximum.
Example: If you set a maximum of 500 shares and your strategy signals to buy 1,000 shares of AAPL, only 500 shares will be ordered.
Maximum notional value
Section titled “Maximum notional value”Set the maximum dollar value for any single position. This is often more useful than a share limit because it automatically adjusts for the price of the instrument.
Example: A $10,000 notional limit means you can hold 100 shares of a $100 stock or 200 shares of a $50 stock, but never more than $10,000 in a single position.
Loss limits
Section titled “Loss limits”Loss limits automatically pause or stop trading when losses exceed a defined threshold. They protect against both strategy drawdowns and unexpected market events.
Daily loss limit
Section titled “Daily loss limit”The maximum amount your account can lose in a single trading day. When the daily loss limit is reached, Stratifyre will:
- Cancel all pending orders.
- Optionally close all open positions (configurable).
- Pause the trading session for the remainder of the day.
- Send you a notification.
Example: If you set a daily loss limit of $500 and your strategy loses $500 by 11:00 AM, all trading stops until the next trading day.
Drawdown limit
Section titled “Drawdown limit”The maximum percentage decline from your account’s peak value. Drawdown limits protect against extended losing streaks that accumulate over days or weeks.
Example: If you set a drawdown limit of 10% and your account peaks at $50,000, trading will halt if the account value drops below $45,000.
How loss limits are calculated
Section titled “How loss limits are calculated”Loss limits are calculated in real time using the current mark-to-market value of your positions plus any realized losses for the period. This means that unrealized losses on open positions count toward your limits, not just closed trades.
Order rate limiting
Section titled “Order rate limiting”Order rate limiting prevents your strategy from submitting too many orders in a short time. This protects against strategy bugs, infinite loops, or runaway logic that could result in excessive trading.
How it works
Section titled “How it works”You set a maximum number of orders per time window – for example, no more than 10 orders per minute. If the strategy attempts to exceed this limit, additional orders are blocked and a warning is logged.
Why it matters
Section titled “Why it matters”Without rate limiting:
- A logic error could cause thousands of orders per second.
- Each order could trigger additional orders (e.g., a buy immediately followed by a sell), creating an order cascade.
- Brokers may suspend your account for excessive order activity.
Rate limiting acts as a sanity check that prevents these scenarios from escalating.
Circuit breakers
Section titled “Circuit breakers”Circuit breakers are the last line of defense. When triggered, they shut down all trading activity immediately, cancel all pending orders, and optionally flatten all positions.
What triggers a circuit breaker
Section titled “What triggers a circuit breaker”Circuit breakers activate when extreme conditions are detected:
- Loss limit breach – If daily loss or drawdown limits are exceeded after accounting for slippage on exit orders.
- Rapid loss detection – If losses accumulate faster than expected within a very short time window.
- System health issues – If the data feed disconnects, the broker connection drops, or internal errors are detected.
- Manual trigger – You can always activate the circuit breaker manually via the emergency stop button.
What happens when a circuit breaker triggers
Section titled “What happens when a circuit breaker triggers”- All pending orders are immediately canceled.
- If configured, all open positions are closed at market price.
- The trading session enters a stopped state.
- You receive an immediate notification through all configured alert channels.
- The session cannot be restarted until you review the situation and manually re-enable it.
Configuring risk controls
Section titled “Configuring risk controls”All risk management settings are configured per trading session. This means different strategies can have different risk parameters based on their characteristics.
Recommended starting configuration
Section titled “Recommended starting configuration”If you are not sure where to start, here is a conservative configuration suitable for most traders:
| Control | Recommended Starting Value |
|---|---|
| Max position (notional) | 5-10% of account value |
| Max position (shares) | Based on your typical trade size |
| Daily loss limit | 1-2% of account value |
| Drawdown limit | 5-10% of account value |
| Order rate limit | 10-20 orders per minute |
| Circuit breaker | Enabled (always) |
Adjusting limits over time
Section titled “Adjusting limits over time”As you gain experience with live trading and build confidence in your strategy’s behavior, you can gradually adjust your risk parameters:
- Increase position limits if your strategy consistently shows strong risk-adjusted returns.
- Widen daily loss limits if the current limit is causing premature shutdowns on normal drawdown days.
- Tighten drawdown limits if you want to preserve more capital during extended losing periods.
- Adjust rate limits based on your strategy’s natural order frequency.
Always make changes incrementally and monitor the impact for several trading days before adjusting further.
Risk management and paper trading
Section titled “Risk management and paper trading”All risk controls are fully active during Paper Trading. This is by design – you should test and validate your risk configuration in paper mode before going live. If your risk limits trigger during paper trading, that is valuable information: either your limits need adjustment or your strategy is riskier than expected.
Next steps
Section titled “Next steps”- Learn about Session Management to understand how to start, pause, stop, and recover trading sessions.
- Review Paper Trading to test your risk configuration with simulated capital.
- See Broker Setup for details on connecting your brokerage account.
