CVaR Pass Node
Conditional Value at Risk — Series Input
Overview
CVaR (Conditional Value at Risk), also called Expected Shortfall (ES), measures the average loss in the worst scenarios beyond the VaR threshold. At 95% confidence it answers: "given that we are in the worst 5% of outcomes, what is the average loss?"
The Pass variant applies this calculation to any upstream returns series, not just price data from a root node.
Formula
period bars using historical simulation.Parameters
| Parameter | Default | Description |
|---|---|---|
| period | 20 | Rolling lookback window in bars |
| confidenceLevel | 0.95 | Confidence level (0–1). 0.95 = worst 5% of returns. |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any upstream returns series |
| values | Output | (number | null)[] | CVaR values (negative = loss); nulls during warm-up |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Portfolio Tail Risk
Apply to portfolio return series to understand expected loss in the worst scenarios — stricter than VaR alone.
Position Sizing
Size positions so that CVaR × position ≤ account risk limit per trade.
Risk Reporting
CVaR / Expected Shortfall is preferred over VaR in regulatory frameworks (Basel III) for tail risk quantification.
Tips & Best Practices
CVaR Always ≥ VaR
CVaR captures the tail beyond VaR. Use both together for a complete risk picture.
Use Log Returns
Feed log-return series for statistically sound risk estimates. Pipe Log Return node → CVaR Pass.
Confidence Level Choice
0.95 focuses on worst 5%; 0.99 focuses on worst 1% — more conservative but noisier with small period.