Lesson 7 of 15

Stress Testing Scenarios

Stress Testing Scenarios

Stress testing evaluates portfolio performance under extreme but plausible market conditions — things like a 2008-style crash, a sudden rate spike, or a flash crash.

Apply Stress

Given a portfolio and a scenario, compute the new portfolio value:

P&L = Σ (weight_i × asset_value_i × shock_i)
new_value = portfolio_value + P&L

Each position is defined by its weight and current market value. Each shock is a percentage change (e.g. -0.10 = −10%).

Common Stress Scenarios

ScenarioEquityCreditRates
2008 Crisis−40%−30%−10%
Tech Crash−35%0%+5%
Rate Spike−10%−15%+30%

Example

Portfolio value = 1,000,000Positions:[(0.6,1,000,000 Positions: [(0.6, 600,000), (0.4, 400,000)] Shocks: [−10%, +5%] P&L = 0.6×600000×(−0.10) + 0.4×400000×(0.05) = −36000 + 8000 = −28000 New value = **972,000**

Python runtime loading...
Loading...
Click "Run" to execute your code.