Run strategies through a stress scenario
run_stress_scenarioRun trading strategies through a macro stress scenario beside an unshocked market, then compare results to detect how each strategy responds. Deterministic and reproducible.
Instructions
Run strategies through a macro stress scenario, always beside the same market unshocked, and compare each strategy across the two. scenario is a shipped document by name (list_scenarios gives each one's first_event_day, and the run must be longer than that), a constructor by name (vix_shock, rate_ramp, timed with peak_day), or a document from build_scenario. A scenario whose events all fall after the run is refused. Pass fork_day to run both markets together first and start the scenario on that day, as a fork of one shared history. Use the result to detect a response, not to forecast its size. days 1 to 60 here, up to 252 through start_job. Deterministic.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Trading days to run: 1 to 60 in a direct call, up to 252 (the certified horizon) through start_job. | |
| seed | No | Simulation seed, an integer from 0 to 2**64 - 1. The same seed and arguments give the same result. | |
| fork_day | No | Run both markets together for this many days, then split them and start the scenario on the first day after the split: day `fork_day` of the run. The scenario's events keep their spacing, and every strategy trades the shared days identically in both arms. 0 to days - 1. Only for a scenario made of interventions (a shipped document, or build_scenario with `shocks`); a macro path or a constructor pins the macro from day 0, so it has no fork point. | |
| peak_day | No | Constructors only. vix_shock: the day the VIX jumps to its peak (default 10). rate_ramp: the day the policy rate and corporate yield reach their end level (default 30). A vix_shock peak must fall inside the run. | |
| scenario | Yes | A shipped document by name (list_scenarios lists them with the day each one's first event falls on, and the run must be longer than that), a constructor by name (vix_shock, rate_ramp, timed with peak_day), or a scenario document from build_scenario. | |
| universe | No | A roster document, usually the `universe` field of a build_universe result. Either {"size": n, "seed": s, "sectors": [...]} or {"instruments": [...]}. When given it replaces universe_size, universe_seed and universe_sectors. | |
| strategies | No | Optional strategies to run beside the baselines, in the evaluate_strategies form. The baseline names are taken. | |
| universe_seed | No | Seed that generates the roster, separate from the simulation seed. Ignored when `universe` is given. | |
| universe_size | No | Names in a generated roster, 2 to 120. Ignored when `universe` is given. | |
| universe_sectors | No | Lowercase sector ids to concentrate a generated roster on, for example ["technology", "energy"]. The ids: technology, financial_services, healthcare, energy, consumer_discretionary, consumer_staples, industrials, materials, real_estate, utilities, telecommunications, transportation. A concentrated roster is a named envelope gap, and the result says so. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||