Stress-test a strategy's returns
stress_testBootstrap strategy returns to gauge drawdown breach frequency and Sharpe negativity. Simulate crash, volatility, repeat, and stuck-position scenarios, with a fragility share.
Instructions
Stress a strategy's returns: bootstrap histories (how often the drawdown limit breaks or Sharpe turns negative) and named crash, volatility, repeat and stuck-position scenarios, with a fragility share. Frequencies over resampled histories are not forecasts of the future.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Default 42; reproduces exactly. | |
| block | No | Mean block length; default cube root of n. | |
| crash | No | Crash size, negative; default min(-0.2, 3x worst period). | |
| paths | No | Default 1000. | |
| returns | No | Strategy returns as fractions, oldest first. | |
| returns_file | No | CSV or JSON of returns on this machine; local server only. | |
| drawdown_limit | No | Fraction; default 0.2. | |
| outage_periods | No | Stuck periods after the worst; default 5. | |
| returns_column | No | Column name or 1-based position. | |
| periods_per_year | No | 252 daily (default), 365 crypto, 52 weekly, 12 monthly. | |
| volatility_multiplier | No | Default 2. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limits | No | ||
| source | No | ||
| baseline | No | ||
| fragility | No | ||
| resampled | No | ||
| scenarios | No | ||
| plain_reading | No |