monte_carlo_simulation
Run Monte Carlo simulation on a portfolio to model distribution of future returns, compute percentile outcomes and probability of loss.
Instructions
Run Monte Carlo simulation on a portfolio to model the distribution of future returns, including percentile outcomes and probability of loss.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| positions | Yes | Array of portfolio positions. Free tier: max 20 positions. Paid tier: up to 500. | |
| num_paths | No | Number of simulation paths to run. More paths = more accurate but slower. Free tier: max 1,000. Paid tier: up to 100,000. Default: 10,000. | |
| horizon_days | No | Simulation horizon in trading days. 21 ≈ 1 month, 63 ≈ 1 quarter, 252 ≈ 1 year. Default: 21. | |
| model | No | Stochastic process model. "gbm" = Geometric Brownian Motion (standard), "jump_diffusion" = adds jump risk for fat-tail scenarios. Default: "gbm". | gbm |
| lookback_days | No | Historical window used to estimate drift and volatility parameters. Range: 30-1260 trading days. Default: 252. | |
| seed | No | Random seed for reproducible results. Omit for a fresh random run each time. |