Skip to main content
Ultra Feature. Requires an Ultra subscription. Get started at api.mathematicalcompany.com

Sentinel

Continuous portfolio risk surveillance that runs inside hz.run() or standalone. Monitors correlations, manages drawdowns with graduated responses, detects regime changes, and suggests hedges.

Drawdown Management

4-level graduated response: alert → reduce → pause → exit.

Regime Detection

Classifies volatility regime and adjusts risk budget multiplier.

Correlation Alerts

Ledoit-Wolf shrinkage detects correlation spikes across positions.

Hedge Suggestions

Delta-based hedge recommendations from prediction Greeks.

Standalone Report

import horizon as hz

engine = hz.Engine()
report = hz.sentinel_report(engine)
print(report.regime)          # "normal", "high_vol", "crisis", etc.
print(report.var_95)          # Cornish-Fisher VaR at 95%
print(report.risk_budget)     # Budget utilisation with regime multiplier

Hedge Suggestions

hedges = hz.suggest_hedges(engine, max_hedges=3, min_reduction_pct=5.0)
for h in hedges:
    print(f"{h.market_id}: {h.side} {h.size} @ {h.price}{h.risk_reduction_pct}% reduction")

Pipeline Mode

hz.run(
    name="guarded-strategy",
    markets=["mkt-a", "mkt-b"],
    pipeline=[
        hz.sentinel(config=hz.SentinelConfig(
            auto_deleverage=True,
            drawdown_thresholds=[
                (-0.05, "alert"),
                (-0.10, "reduce"),
                (-0.20, "pause"),
                (-0.30, "exit"),
            ],
        )),
        model,
        quoter,
    ],
    interval=1.0,
)
Injects ctx.params["sentinel_report"] every N cycles.

Graduated Drawdown Response

ThresholdActionBehaviour
-5%alertLog warning only
-10%reduceCancel 50% of open orders (largest first)
-20%pauseCancel all open orders
-30%exitCancel all + submit exit orders for all positions

Regime Detection

Portfolio volatility determines the regime and risk budget multiplier:
RegimeVolatilityMultiplier
low_vol< 5%1.5× (take more risk)
normal5-15%1.0×
high_vol15-30%0.5× (reduce risk)
crisis> 30%0.25× (minimal risk)

SentinelConfig

ParameterDefaultDescription
drawdown_thresholds[(-0.05,"alert"), ...]Graduated response levels
correlation_spike_threshold0.3Flag when correlation jumps by this
auto_hedgeFalseAutomatically execute hedge suggestions
auto_deleverageTrueAutomatically reduce positions on drawdown
regime_sensitivity1.0Scaling factor for regime thresholds
var_confidence0.95VaR confidence level
lookback_returns100Rolling window for return calculations
risk_budget_total10000.0Total risk budget in USDC