risk
Calculate financial risk metrics (VaR, CVaR, drawdown, volatility, and more) from raw price data. Supports rolling windows and multiple tickers to quantify downside exposure and portfolio risk.
Instructions
Pre-computed risk metrics (VaR incl. historic/gaussian/cf/studentt/evt distributions, CVaR, EVaR, GARCH volatility, max drawdown, drawdown duration, drawdown recovery time, Conditional Drawdown at Risk (CDaR), Tail Ratio, skewness, kurtosis, downside deviation, Variance, Volatility incl. close_to_close/parkinson/garman_klass/rogers_satchell/yang_zhang estimators, Excess Volatility). VaR, CVaR, skewness, kurtosis, CDaR, Tail Ratio, downside deviation, Variance, Volatility and Excess Volatility support rolling=N for a rolling N-period value spanning the full history instead of one value per period (e.g. period='monthly', rolling=6 for a rolling 6-month figure). Requires tickers='AAPL' — use comma-separated values for multiple tickers. Does NOT support period='daily'; use weekly, monthly, quarterly, or yearly instead.
Available indicators: get_acerbi_szekely_test, get_amihud_illiquidity, get_autocorrelation, get_best_fitting_copula, get_coefficient_of_variation, get_component_value_at_risk, get_conditional_drawdown_at_risk, get_conditional_value_at_risk, get_copula_parameters, get_copula_simulation, get_covar, get_downside_deviation, get_egarch, get_egarch_forecast, get_egarch_parameters, get_entropic_value_at_risk, get_ewma_volatility, get_excess_volatility, get_garch, get_garch_forecast, get_garch_parameters, get_gjr_garch, get_gjr_garch_forecast, get_gjr_garch_parameters, get_har_rv_forecast, get_hill_estimator, get_hurst_exponent, get_kurtosis, get_marginal_value_at_risk, g
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Value for k. | |
| q | No | Value for q. | |
| dof | No | Value for dof. | |
| lag | No | Number of periods to lag when computing growth rates. | |
| lags | No | Value for lags. | |
| tail | No | Value for tail. | left |
| test | No | Value for test. | both |
| alpha | No | Value for alpha. | |
| scale | No | Value for scale. | |
| column | No | Value for column. | Return |
| copula | No | Value for copula. | gaussian |
| fisher | No | Value for fisher. | |
| growth | No | Return period-over-period growth rates instead of absolute values. | |
| method | No | Value for method. Leave unset to use the default of the indicator you selected. Defaults are 'close_to_close' for get_volatility; 'empirical' for get_tail_dependence_coefficient. | |
| period | No | Observation frequency, e.g. 'monthly', 'quarterly', or 'annual'. | |
| ticker | No | Value for ticker. Leave unset to use the default of the indicator you selected. Required by: get_covar. | |
| horizon | No | Value for horizon. | |
| lambda_ | No | Value for lambda_. | |
| max_lag | No | Value for max_lag. | |
| rolling | No | Rolling window size in number of periods. When set, the metric is computed over a smoothly overlapping trailing window across the full history (e.g. period='monthly' and rolling=6 gives a rolling 6-month value) instead of one value per period, or (for economics indicators) a simple moving average used to smooth the raw series. Leave unset to use the default of the indicator you selected. Defaults are None for get_conditional_drawdown_at_risk, get_conditional_value_at_risk, get_downside_deviation, get_excess_volatility, get_kurtosis, get_skewness, get_tail_ratio, get_value_at_risk, get_variance, get_volatility; 14 for get_ulcer_index. | |
| tickers | No | Comma-separated ticker symbols, e.g. 'AAPL,MSFT,GOOGL'. | |
| weights | No | Value for weights. | |
| end_date | No | End of the date range in YYYY-MM-DD format. | 2026-08-19 |
| ticker_a | No | Value for ticker_a. Leave unset to use the default of the indicator you selected. Required by: get_tail_dependence_coefficient. Defaults are None for get_best_fitting_copula, get_copula_parameters, get_copula_simulation. | |
| ticker_b | No | Value for ticker_b. Leave unset to use the default of the indicator you selected. Required by: get_tail_dependence_coefficient. Defaults are None for get_best_fitting_copula, get_copula_parameters, get_copula_simulation. | |
| estimator | No | Value for estimator. | squared_return |
| indicator | Yes | Name of the specific metric to calculate, e.g. 'get_asset_turnover_ratio'. Required — omitting it returns the list of available indicators. | |
| quarterly | No | Return quarterly data instead of annual when True. | |
| start_date | No | Start of the date range in YYYY-MM-DD format. | 2021-08-20 |
| time_steps | No | Value for time_steps. Leave unset to use the default of the indicator you selected. Defaults are 10 for get_egarch_forecast, get_garch_forecast, get_gjr_garch_forecast; None for get_egarch, get_garch, get_gjr_garch. | |
| n_bootstrap | No | Value for n_bootstrap. | |
| standardize | No | Return the Z-Score (standard score) instead of the raw values, i.e. how many standard deviations each value is from the mean of its own series. When combined with growth=True, the growth values are standardized instead of the raw values. | |
| window_size | No | Value for window_size. | |
| distribution | No | Value for distribution. | historic |
| random_state | No | Value for random_state. | |
| show_columns | No | Comma-separated names to filter the output. For historical data use the key names visible in any response record (e.g. 'Close,Volume,Return'). For financial statements use the 'metric' field values from the response (e.g. 'Revenue,Net Income,EBITDA'). Call the tool once without this parameter to see all available names, then repeat with show_columns to reduce response size and token usage. | |
| n_simulations | No | Value for n_simulations. | |
| weekly_window | No | Value for weekly_window. | |
| within_period | No | Value for within_period. Leave unset to use the default of the indicator you selected. Defaults differ between indicators. | |
| monthly_window | No | Value for monthly_window. | |
| optimization_t | No | Value for optimization_t. | |
| benchmark_ticker | No | Ticker used as the market benchmark, e.g. 'SPY' or '^GSPC'. | SPY |
| empirical_margins | No | Value for empirical_margins. | |
| show_full_results | No | Value for show_full_results. | |
| conditioning_ticker | No | Value for conditioning_ticker. Leave unset to use the default of the indicator you selected. Required by: get_covar. | |
| threshold_percentile | No | Only used when distribution='evt'. The percentile of losses above which the Generalized Pareto Distribution is fitted, e.g. 0.95 fits on the worst 5% of losses. | |
| minimum_acceptable_return | No | The minimum acceptable return (MAR) threshold below which returns are considered downside, e.g. 0.0 for downside relative to a zero return. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |