Datastore Historical¶
The Datastore Historical worker calculates the historical magnitude of a security's reaction to changes in underlying factors, and returns the results as a datastore.

Parameters¶
Input¶
| Field | Description |
|---|---|
| Portfolio | The target portfolio. Accepts Fixed Portfolio, Get Latest, or Upstream Data |
| Workspace | Workspace of the portfolio. Accepts Fixed Workspace. Defaults to the current workspace |
| Volatility | Whether to calculate volatility at the Security and/or Portfolio level. Accepts Boolean |
| VaR | Whether to calculate Value at Risk at the Security and/or Portfolio level. Accepts Boolean |
| CVaR | Whether to calculate Conditional VaR at the Security and/or Portfolio level. Accepts Boolean |
| Stress Test | Whether to calculate stress test results at the Security and/or Portfolio level. Accepts Boolean |
| BVaR | Whether to calculate Portfolio BVaR. Accepts Boolean |
| Max Drawdown | Whether to calculate Portfolio Max Drawdown. Accepts Boolean |

Output¶
| Field | Description |
|---|---|
| Name | Name of the output datastore. Accepts Template Text or Upstream Data. Defaults to the portfolio name |
| Date | Date of the output datastore. Accepts Fixed Date or Upstream Data. Defaults to the portfolio date |
| Workspace | Workspace where the output datastore will be saved. Accepts Fixed Workspace. Defaults to the portfolio workspace |
| Tags | Tags for the output datastore. Accepts Fixed Tags or Upstream Data. Defaults to the portfolio tags |
| Storage Mode | Transient — exists only within the current workflow run (default); Create — saves the datastore to the platform |

Advanced¶
| Field | Description |
|---|---|
| Header Suffix | Suffix appended to the end of property column names in the output datastore. Accepts Template Text or Upstream Data. Default is no suffix |
| Days | Number of business days used to calculate the covariance for the primitive risk factors. Default is 252 |
| Exponential Decay | Weighting factor determining the rate at which older data enters the calculation. Default is 0.94 |
| Sampling | Frequency at which historical prices and rates are sampled to compute risk factors. Use 1 for daily, 5 for weekly (non-overlapping). Default is 1 |
| Horizon | The forecast horizon for calculation. Produces a range of outcomes for each security via their underlying factors across a specific date range. Default is 1-day forecast |
| Confidence | Confidence level for calculation. For example, at 95% confidence with 10,000 simulations, the first 5% (500 samples) are used. Default is 95% |

Result¶
Once the worker finishes successfully, it returns a result object containing the datastore.
- Datastore (datastore)
- ID (string)
- Name (string)
- Date (date)
- Tags (list of strings)
- Data (list of lists)
The Data component includes the following columns:
port_historical_bvarport_historical_cvarport_historical_max_drawdownport_historical_st_dateport_historical_st_valueport_historical_varport_historical_volsec_historical_cvarsec_historical_st_valuesec_historical_varsec_historical_vol