CVaR Pass Node

Conditional Value at Risk — Series Input

StatisticalRiskPass

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

CVaR = E[X | X ≤ VaR_α]
= mean of worst (1 − α) × 100% returns in the window
CVaR is always ≥ VaR in absolute terms. Rolling over period bars using historical simulation.

Parameters

ParameterDefaultDescription
period20Rolling lookback window in bars
confidenceLevel0.95Confidence level (0–1). 0.95 = worst 5% of returns.

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Any upstream returns series
valuesOutput(number | null)[]CVaR values (negative = loss); nulls during warm-up
timestampsOutputnumber[]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.

Related Indicators