Skip to content

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.

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 control how much capital can be allocated to any single position, preventing overconcentration in one instrument.

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.

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 automatically pause or stop trading when losses exceed a defined threshold. They protect against both strategy drawdowns and unexpected market events.

The maximum amount your account can lose in a single trading day. When the daily loss limit is reached, Stratifyre will:

  1. Cancel all pending orders.
  2. Optionally close all open positions (configurable).
  3. Pause the trading session for the remainder of the day.
  4. 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.

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.

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 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.

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.

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 are the last line of defense. When triggered, they shut down all trading activity immediately, cancel all pending orders, and optionally flatten all positions.

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”
  1. All pending orders are immediately canceled.
  2. If configured, all open positions are closed at market price.
  3. The trading session enters a stopped state.
  4. You receive an immediate notification through all configured alert channels.
  5. The session cannot be restarted until you review the situation and manually re-enable it.

All risk management settings are configured per trading session. This means different strategies can have different risk parameters based on their characteristics.

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)

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.

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.

  • 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.