> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Context Values

> Reference for the 9 context values available in Atoti Market Risk cubes, including confidence levels for VaR, ES, ETG, and VaE, plus VaRTimePeriod, WeightedVaRLambda, ReferenceLevel, ShiftPercentile, and PercentileBuckets

Some of the calculation parameters are exposed via Context Values and you can override them on-the-fly to visualize the impact.

For an exhaustive list of all context values available for this version of Atoti Server, see the [Atoti Server Documentation](https://docs.activeviam.com/engine/java-sdk/6.1/cube/context_values.md).

## Context Values

| Context Value | Description |
| - | - |
| ESConfidenceLevel | ES confidence level for the generic ES measure |
| ETGConfidenceLevel | ETG confidence level for the generic ETG measure |
| PercentileBuckets | Number of buckets for the empirical distribution charts |
| ReferenceLevel | The level used by comparator measures to build a drill-up reference location |
| ShiftPercentile | The default percentile of market shifts when displayed by the `x Shift Vector Percentile` measures |
| VaEConfidenceLevel | VaE confidence level for the generic VaE measure |
| VaRConfidenceLevel | VaR confidence level for the generic VaR measure |
| VaRTimePeriod | VaR time period |
| WeightedVaRLambda | Parameter lambda for the exponentially weighted historical tail measures |

The confidence level context values (ESConfidenceLevel, ETGConfidenceLevel, VaEConfidenceLevel, VaRConfidenceLevel) can be used to override the default confidence level in their respective calculations.

## PercentileBuckets

Controls the number of buckets used by the distribution histograms. If a user changes it to, say, 10, the PnL values are re-bucketed and the distribution charts updated.

![PnL Distribution charts using the PercentileBuckets context value](https://mintcdn.com/activeviam/tAG1tCcFCMIoCw-t/solutions/market-risk/6.0/images/percentilebuckets.gif?s=a0a2d9195a9624f495098860da918d26)

## ReferenceLevel

The ReferenceLevel context value sets the cube level used to build a drill-up location that serves as a reference for comparison (it drives the reference-level shift post-processor). The reference location is the grand total ("Enterprise", the top of house), except for the selected level, which is taken from the current location. The default empty slot behaves like this top location.

Levels are given in `Level@Hierarchy` form (for example, `Desk@Desks` or `Level 5@BookHierarchy`). The list of selectable levels is configurable through the `mr.cubes.context-values.reference-levels` property in the [Common module properties](https://docs.activeviam.com/solutions/market-risk/6.0/properties/config-properties/mr-common-config.md), which defaults to:

* *(empty)*: the top location (Enterprise / grand total)
* `Book@Books`
* `Desk@Desks`
* `Legal Entity@Legal Entities`
* `Level 1@BookHierarchy`, `Level 2@BookHierarchy`, `Level 3@BookHierarchy`, `Level 4@BookHierarchy`, `Level 5@BookHierarchy`
* `Level 1@LegalEntityHierarchy`, `Level 2@LegalEntityHierarchy`

![Reference Level Illustration](https://mintcdn.com/activeviam/tAG1tCcFCMIoCw-t/solutions/market-risk/6.0/images/referencelevel.png?fit=max\&auto=format\&n=tAG1tCcFCMIoCw-t\&q=85\&s=b8d64748cfde34f9348559d0a39f1c4d)

## VaRTimePeriod

Works in conjunction with the `Liquidity Horizon` field in the [Scenario](https://docs.activeviam.com/solutions/market-risk/6.0/input-files/scenarios.md) input table. Scales VaR vectors to the specified time period using the Square Root of Time rule.

$VaR_{n\text{-days}} = VaR_{1\text{-day}} \cdot \sqrt{n}$

**Example:** If scenarios contain both 10-day and 1-day vectors and VaRTimePeriod is set to 1, the 10-day vectors are normalized to 1 day while the 1-day vectors are unchanged.

> [!NOTE]
>
> 10-day VaR and 1-day VaR should not be aggregated; Liquidity Horizon should be used as a slicing hierarchy.

## WeightedVaRLambda

Overrides the default value of the decay factor lambda used in the exponentially weighted historical simulation (WHS) approach. See [Weighted VaR](https://docs.activeviam.com/solutions/market-risk/6.0/calculations/whs.md).
