Skip to main content
POST
/
quantlib
/
risk
/
backtest
Backtest VaR Model
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/risk/backtest \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "actual_returns": [
    -0.008,
    0.012,
    -0.018,
    0.005,
    -0.032,
    0.009,
    -0.015
  ],
  "var_estimates": [
    0.025,
    0.025,
    0.025,
    0.025,
    0.025,
    0.025,
    0.025
  ],
  "confidence": 0.95
}
'
{
  "success": true,
  "data": {
    "exceptions": 12,
    "total_observations": 252,
    "exception_rate": 0.0476,
    "expected_exceptions": 12.6,
    "kupiec_lr_stat": 0.342,
    "kupiec_p_value": 0.558,
    "christoffersen_stat": 1.234,
    "christoffersen_p_value": 0.266,
    "traffic_light": "green"
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
actual_returns
number[]
required

Historical actual portfolio returns

Minimum array length: 250
Example:
[-0.02, 0.01, -0.015]
var_estimates
number[]
required

Corresponding VaR estimates (positive values representing losses)

Example:
[0.025, 0.025, 0.025]
confidence
number
default:0.99

Confidence level used for VaR estimates

Example:

0.99

Response

Backtest results with statistical tests

success
boolean
Example:

true

data
object