feat: causal lab
This commit is contained in:
@@ -900,6 +900,91 @@ BUILT_IN_TEMPLATES = [
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
# 13. MACRO_RATE_GUIDANCE (auto-créé par guidance_sync — pas dans REGIME_SLUGS)
|
||||
# Anticipation d'une décision de taux avant l'event : repricing progressif OIS
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
{
|
||||
"name": "Macro Rate Guidance",
|
||||
"slug": "MACRO_RATE_GUIDANCE",
|
||||
"category": "central_bank",
|
||||
"sub_type": "guidance",
|
||||
"heuristic_ver": 2,
|
||||
"calibration_json": {"lag_days": 0, "half_life_days": 30, "absorption_days": 60, "decay_type": "linear"},
|
||||
"instruments": ["EURUSD", "TLT", "USDJPY", "SP500", "XAUUSD", "GBPUSD", "EEM", "QQQ"],
|
||||
"description": "Anticipation marché d'une décision de taux — pricing-in progressif avant l'event (OIS forwards, carry FX, duration bonds)",
|
||||
"ai_rationale": "Quand le consensus se forme autour d'un cut/hike, les OIS forwards repricing graduellement. Le carry FX shift avant la décision. TLT monte si cut attendu. Signal = forecast - previous en bps. Signal=0 = marché neutre (status quo).",
|
||||
"graph_json": {
|
||||
"nodes": [
|
||||
_n("guidance_signal", "Expected Δ Rate", "input", 400, 50, unit="bps",
|
||||
description="Positif=hike attendu, Négatif=cut attendu (bps)"),
|
||||
_n("ois_forward", "OIS Fwd Shift", "observable", 180, 200,
|
||||
formula="guidance_signal * {{coef_signal_ois}}", unit="bps"),
|
||||
_n("usd_carry", "USD Carry Shift", "observable", 60, 350,
|
||||
formula="ois_forward * {{coef_ois_carry}}", unit="%"),
|
||||
_n("rate_expectation", "Rate Path Exp.", "latent", 400, 350,
|
||||
formula="ois_forward * {{coef_ois_re}}"),
|
||||
_n("risk_premium", "Risk Premium", "latent", 700, 350,
|
||||
formula="guidance_signal * {{coef_signal_rp}}",
|
||||
description="Négatif si cut (risk-on), positif si hike (risk-off)"),
|
||||
# Outputs row 1
|
||||
_n("eurusd", "EUR/USD", "market_asset", 60, 530, formula="-usd_carry * {{coef_carry_eurusd}}", unit="pips", instrument="EURUSD"),
|
||||
_n("tlt", "TLT Bond", "market_asset", 240, 530, formula="-rate_expectation * {{coef_re_tlt}}", unit="pts", instrument="TLT"),
|
||||
_n("usdjpy", "USD/JPY", "market_asset", 420, 530, formula="usd_carry * {{coef_carry_usdjpy}}", unit="pips", instrument="USDJPY"),
|
||||
_n("sp500", "S&P 500", "market_asset", 600, 530, formula="-risk_premium * {{coef_rp_sp}} + rate_expectation * {{coef_re_sp}}", unit="pts", instrument="SP500"),
|
||||
# Outputs row 2
|
||||
_n("xauusd", "Gold", "market_asset", 60, 680, formula="-usd_carry * {{coef_carry_gold}} - rate_expectation * {{coef_re_gold}}", unit="$/oz", instrument="XAUUSD"),
|
||||
_n("gbpusd", "GBP/USD", "market_asset", 240, 680, formula="-usd_carry * {{coef_carry_gbpusd}}", unit="pips", instrument="GBPUSD"),
|
||||
_n("eem", "EEM Emerg", "market_asset", 420, 680, formula="-usd_carry * {{coef_carry_eem}} - risk_premium * {{coef_rp_eem}}", unit="pts", instrument="EEM"),
|
||||
_n("qqq", "QQQ Nasdaq", "market_asset", 600, 680, formula="-rate_expectation * {{coef_re_qqq}} - risk_premium * {{coef_rp_qqq}}", unit="pts", instrument="QQQ"),
|
||||
],
|
||||
"edges": [
|
||||
_e("guidance_signal", "ois_forward", "solid", "policy_fwd_pricing", strength=3, sign="positive", label="hike→OIS up / cut→OIS dn"),
|
||||
_e("guidance_signal", "risk_premium", "dashed", "risk_channel", strength=2, sign="positive", label="hike=risk-off / cut=risk-on"),
|
||||
_e("ois_forward", "usd_carry", "solid", "carry_diff", strength=3, sign="positive"),
|
||||
_e("ois_forward", "rate_expectation", "solid", "fwd_path", strength=3, sign="positive"),
|
||||
# FX
|
||||
_e("usd_carry", "eurusd", "solid", "fx_eurusd", strength=3, sign="negative", label="USD up → EUR/USD dn"),
|
||||
_e("usd_carry", "usdjpy", "solid", "fx_usdjpy", strength=2, sign="positive", label="USD up → USD/JPY up"),
|
||||
_e("usd_carry", "gbpusd", "solid", "fx_gbpusd", strength=2, sign="negative"),
|
||||
_e("usd_carry", "eem", "solid", "usd_eem", strength=2, sign="negative"),
|
||||
# Bonds
|
||||
_e("rate_expectation","tlt", "solid", "bond_dur", strength=3, sign="negative", label="hike exp → TLT dn"),
|
||||
# Equities
|
||||
_e("risk_premium", "sp500", "solid", "equity_rp", strength=2, sign="negative"),
|
||||
_e("rate_expectation","sp500", "dashed", "disc_rate", strength=2, sign="negative", label="hike → discount rate up → SP dn"),
|
||||
_e("risk_premium", "qqq", "dashed", "tech_rp", strength=2, sign="negative"),
|
||||
_e("rate_expectation","qqq", "solid", "tech_dur", strength=3, sign="negative", label="QQQ = long duration"),
|
||||
_e("risk_premium", "eem", "dashed", "em_risk", strength=2, sign="negative"),
|
||||
# Gold
|
||||
_e("usd_carry", "xauusd", "solid", "usd_gold", strength=2, sign="negative"),
|
||||
_e("rate_expectation","xauusd", "dashed", "real_rate", strength=2, sign="negative", label="hike exp → real rates up → gold dn"),
|
||||
],
|
||||
"coefficients": {
|
||||
"coef_signal_ois": _c(0.8, "bps signal → OIS shift (same sign: hike=up, cut=down)"),
|
||||
"coef_ois_carry": _c(0.4, "OIS shift → USD carry %"),
|
||||
"coef_ois_re": _c(0.9, "OIS shift → rate expectation index"),
|
||||
"coef_signal_rp": _c(0.3, "signal bps → risk premium (hike=risk-off positive)"),
|
||||
"coef_carry_eurusd": _c(60, "1% USD carry → EUR/USD pips fall"),
|
||||
"coef_carry_usdjpy": _c(80, "1% USD carry → USD/JPY pips rise"),
|
||||
"coef_carry_gbpusd": _c(50, "1% USD carry → GBP/USD pips fall"),
|
||||
"coef_carry_eem": _c(20, "1% USD carry → EEM pts fall"),
|
||||
"coef_carry_gold": _c(50, "1% USD carry → Gold $/oz fall"),
|
||||
"coef_re_tlt": _c(12, "rate exp index → TLT pts fall (~12y duration)"),
|
||||
"coef_rp_sp": _c(30, "risk premium → SP500 pts fall"),
|
||||
"coef_re_sp": _c(20, "rate expectation → SP500 pts fall (discount rate)"),
|
||||
"coef_re_qqq": _c(45, "rate exp → QQQ pts fall (high duration)"),
|
||||
"coef_rp_qqq": _c(25, "risk premium → QQQ pts fall"),
|
||||
"coef_rp_eem": _c(15, "risk premium → EEM pts fall"),
|
||||
"coef_re_gold": _c(15, "rate exp → Gold $/oz fall (real rate)"),
|
||||
},
|
||||
"instruments": ["EURUSD", "TLT", "USDJPY", "SP500", "XAUUSD", "GBPUSD", "EEM", "QQQ"],
|
||||
"input_mapping": {
|
||||
"guidance_signal": {"source": "guidance_bps", "unit": "bps", "range": [-200, 200]}
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user