Parametric Stress Test¶
Computes a parametric stress test for the portfolio, estimating portfolio losses under predefined regulatory and factor shock scenarios using a parametric (analytical) approach rather than full Monte Carlo revaluation.
HTTP Request
POST /calculations/parametric_stress_test
HTTP Parameters
| Parameter | Description |
|---|---|
portfolio_id string |
optional The ID of an existing portfolio. When provided, the calculation uses the portfolio's securities, date, base currency, and NLV. The securities parameter is no longer required. |
securities array |
REQUIRED * An array of objects describing the securities in the portfolio. Each object includes a unique id, symbol, quantity, and label. For more details click here. * Not required if portfolio_id is provided. |
date string date |
optional, default is null (today) Portfolio date in the format: YYYYMMDD. |
base_currency string |
optional, default is USD 3-letter ISO 4217 currency code. |
nlv float |
optional, default is null (calculated) Net liquidating value (NAV) of the portfolio. |
use_cashflow boolean |
optional, default is True For fixed income securities: True maps each cashflow event to key points in the interest rate curve; False uses Macaulay duration instead. |
factor_model string |
optional, default is beta Factor model to use for stress test. Accepts: beta or b3_core. Any other value returns an error when you do not send custom_shocks. |
st_worst_method string |
optional, default is by_factor Method used to compute the worst-case stress test scenario. Accepts: by_factor. |
b3_core_method string |
optional, default is standard B3 core margin calculation method. Accepts: standard. |
historical_days integer |
optional, default is 252 Number of business days used to compute the factor covariance matrix. |
custom_shocks object |
optional, default is null An object defining custom shock scenarios to apply on top of the built-in scenarios. |
projection array |
optional, default is ["IND:SPX"] Array of securities used as the top-down factor model. Maximum: 15 elements. |
projection_model object |
optional The factors of the top-down factor model, with a name and a label for each factor. When you send it, the API ignores projection. See Projection model. |
filter string |
optional, default is null Filter expression to select a subset of securities for display. See Filter Expression. |
model string |
optional, default is v1 The calculation engine: v1 or v2. See Calculation model. |
To calculate the parametric stress test, run the following:
The above call returns the following JSON object:
{
"parametric_stress_test": {
"results": {
"port_parametric_st_bear_b3": -531.94,
"port_parametric_st_bull_b3": 475.35,
"port_parametric_st_worst_b3": -531.94,
"port_parametric_st_base_custom": -99.0,
"sec_parametric_st_bear_b3": {
"id1": [-531.94]
},
"sec_parametric_st_bull_b3": {
"id1": [475.35]
},
"sec_parametric_st_worst_b3": {
"id1": [-531.94]
},
"factor_labels": ["IND:BVSP"],
"parametric_st_shocks": {
"bear": [-0.0085, ...],
"bull": [0.0107, ...],
"worst": [-0.0085, ...]
}
},
"unmapped_tickers": []
}
}
The example shows part of the response for factor_model beta. The results object also contains sec_parametric_st_base_custom, sec_parametric_cvm_q12 to sec_parametric_cvm_q15, port_parametric_cvm_q11_total, port_parametric_cvm_q11_bvsp, port_parametric_cvm_q11_coupon, port_parametric_cvm_q11_fx, port_parametric_cvm_q11_ipca, port_parametric_cvm_q11_pre, port_parametric_cvm_q12 to port_parametric_cvm_q16 and all_factors_labels.
With factor_model b3_core, results contains only port_parametric_st_bear_b3, port_parametric_st_bull_b3, port_parametric_st_worst_b3, sec_parametric_st_bear_b3, sec_parametric_st_bull_b3, sec_parametric_st_worst_b3, parametric_st_shocks and factor_labels.
When you send custom_shocks, results contains sts_shock_description and sec_parametric_sts_custom.
This calculation accepts only the position aggregation.