calibrate_vol_coord
Fit the volatility-coordinated decay to your own Risk Navigator curve by supplying shock/PnL points; the fit is stored as the default for later stress tests.
Instructions
Fit vol_coord_decay to YOUR Risk Navigator, and keep the result.
vol_coord reproduces IB's volatility-coordinated model. Its asymmetry — a
fall moves volatility ten times as hard as a rise — is IB's, documented.
Its term damping VR(t) is not: IB says only that the function exists and
is decreasing. The number this server ships was fitted to one screenshot
of somebody else's Risk Navigator, from nine points read off a chart by
eye. It has no claim on your book, every vol_coord result says so in
warnings, and this tool is how you replace it.
What to do:
In TWS open Risk Navigator's risk graph, on the Equity tab if you use the default scope.
Read the Vol.Coord. curve — the one that responds to volatility, not the constant-volatility line — at four or more shocks spread across the range you care about.
Pass them in as
{shock: -0.20, pnl: -28000}pairs, shocks as fractions.
The fit comes back with the residual at every point and, more usefully, with what to distrust about it: the tenor range your positions actually constrain, and the most extreme volatility the fitted decay produces. A decay that reproduces the curve by pricing a wing at 150% has fitted the chart rather than the market, and it says so rather than leaving you to find out three layers down in a P&L.
Unless persist=false, the fit is written to disk and becomes the default
vol_coord_decay for every later stress_curve on this machine — no
restart, no carrying the number by hand — together with what it was fitted
against, which is then reported in assumptions.volCoordDecaySource. Set
IBKR_CALIBRATION_FILE to move the file. It is the only thing this server
writes.
A fit taken against a portfolio that does not reconcile is returned but
not stored. The reason is asymmetry of failure: a curve that is missing
a position announces itself through reconciled, while a decay that
absorbed the same gap would go on silently deforming every vol_coord run
afterwards.
Nothing here trades or quotes. It reads positions and reprices locally.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| betas | No | ||
| scope | No | Match the Risk Navigator tab the readings came from. Its Equity tab is 'equity', the default. | equity |
| persist | No | Store the fit as this machine's standing calibration, so every later stress_curve uses it without being told. Set false to see the fit without adopting it. A fit against a portfolio that does not reconcile is never stored, whatever this says. | |
| targets | Yes | Four or more points read off Risk Navigator's Vol.Coord. curve, spread across the range you care about. Three is the minimum the fit will accept and it constrains almost nothing; points bunched near the money constrain nothing at all. Get them from the Equity tab if you run the default scope='equity', so the curve you are fitting to excludes FX and rates the same way this engine does. | |
| vol_mode | No | Match the run you intend to use the decay in. sticky_strike is the default everywhere else and is what Risk Navigator's own curve does. | sticky_strike |
| fetch_skew | No | ||
| risk_groups | No | Same override as elsewhere, e.g. {'TLT': 'rates'}. Use the same one you pass to stress_curve, or the fit is against a different book than the runs that will use it. | |
| default_beta | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||