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
2Stress Test Results
Stress Test Results — Max DD by Scenario
3Designing Good Stress Tests
4Parameter Sensitivity — What Breaks?
System Profitability vs Win Rate Degradation
5You Can't Test Everything
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
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.