← Back to Learn
III AdvancedWeek 10 • Lesson 27Duration: 50 min

STR Stress Testing Trading Systems

Breaking your strategy on purpose so the market doesn't do it for you

Learning Objectives

  • Understand stress testing methodology for trading systems
  • Design realistic worst-case scenarios
  • Know how stress tests inform risk parameters
  • Build a practical stress test checklist

Explain Like I'm 5

Stress testing is intentionally putting your strategy through the worst possible scenarios. It's crash-testing a car — you don't wait for a real accident to see if the airbags work. You crash it in a lab first.

Think of It This Way

A fire drill. You practice evacuating when there's no fire so that when there is one, you know what to do. For trading: simulate crashes, flash events, and liquidity crises before they happen so your system handles them automatically.

1Three Types of Stress Tests

You should run all three. Historical scenario replay. Run your strategy through known crisis periods: 2008 financial crisis, March 2020 COVID crash, 2022 crypto winter, 2015 CHF flash crash. If your system survived these in backtest, that's a start. Hypothetical scenarios. Design worst cases that haven't happened yet: 10 consecutive losing trades, spreads widening 5×, three simultaneous gap-downs on correlated positions. What breaks first? Parameter sensitivity. What if your assumptions are wrong? Win rate drops from 59% to 50%. Average win shrinks 30%. ATR estimates are off by 50%. These tests reveal which assumptions your system is most fragile to. The parameter sensitivity tests are the most revealing. They show you exactly where your fragility lies.

2Stress Test Results

Each bar is the max drawdown under a specific stress scenario. The dotted line is your hard limit. Below it means the system survived. Above means you're done. Individual scenarios are generally survivable. The "everything goes wrong" compound scenario gets close to the limit. That's why you need multiple layers of defense — no single layer handles the absolute worst case alone.

Stress Test Results — Max DD by Scenario

3Designing Good Stress Tests

Three properties of useful stress tests: Plausible. Scenarios that could realistically happen. "Asteroid destroys NYSE" is useless. "Spread widens 3× during NFP" is useful and has actually happened. Severe. Push the system to its limits. If every test passes easily, your tests are too soft. Specific. Each test should target one risk factor. "Everything goes wrong" is too vague. "Win rate drops to 45% for three months" is specific and testable. The best stress tests are the ones that make you uncomfortable. If you're not nervous about the results, you haven't tested hard enough.

4Parameter Sensitivity — What Breaks?

Take your key parameters and ask: how wrong can this be before I'm in trouble? • Win rate — what if it drops from 59% to 52%? Still profitable? Barely? • Average win size — what if winners are 30% smaller? Still net positive? • Trade frequency — what if you get 40% fewer trades? Can you still pass a challenge in time? • Correlation — what if asset correlations spike to 0.9? What's your real exposure? The answers tell you where your system is fragile. Patch those weaknesses before deployment.

System Profitability vs Win Rate Degradation

5You Can't Test Everything

Here's the uncomfortable truth: your system will eventually face something you didn't test for. Black swans are unexpected by definition. So what do you do? Design for generic resilience: • Circuit breakers that halt trading when things get weird • Position limits that cap maximum exposure • DD-triggered risk scaling that adapts to any adverse scenario • Human oversight for edge cases the algorithm can't handle The best risk management isn't predicting every crisis. It's building a system that degrades gracefully under any adverse condition. Test for specifics, but design for generality. Taleb, N.N. (2007). "The Black Swan." Random House.

Key Formulas

Stressed VaR

VaR scaled by the volatility ratio under stress vs normal conditions. If stress volatility is 3× normal, SVaR is about 1.7× normal VaR. Quick approximation for how risk scales under stress.

Hands-On Code

Stress Test Suite

python
import numpy as np

def stress_consecutive_losses(risk_pct, n_consecutive, balance=100_000):
    """What happens with N consecutive stop-outs?"""
    for i in range(n_consecutive):
        balance -= balance * risk_pct
    dd = 1 - balance / 100_000
    print(f"{n_consecutive} consecutive losses at {risk_pct:.1%}:")
    print(f"  Balance: {balance:,.0f}, DD: {dd:.2%}")
    return balance

def stress_win_rate(actual_wr, n_trades=200, avg_win=1.5, avg_loss=1.0):
    """What if win rate differs from expected?"""
    ev = actual_wr * avg_win - (1 - actual_wr) * avg_loss
    total = ev * n_trades
    print(f"Win rate {actual_wr:.0%}: EV/trade={ev:.3f}R, ")
    print(f"  {n_trades} trades → {total:+.1f}R")

print("=== STRESS TESTS ===")
stress_consecutive_losses(0.003, 20)
stress_win_rate(0.52)

Automated stress testing finds vulnerabilities before the market does. Run these before deployment, and re-run after any parameter changes.

Knowledge Check

Q1.Your system passes all stress tests comfortably. Does this guarantee safety?

Assignment

Design 5 stress test scenarios for your system. Run each one and document: (1) scenario, (2) expected impact, (3) actual impact, (4) mitigation strategy if it exceeds tolerance.