Logo: Black Swan Playbook For Halted Markets

Black Swan Playbook For Halted Markets

Communautéit
HimanshuJ16
black-swan-playbook-for-halted-markets

Benotzt dëst, wann eng Handelsplaz eng LULD-Paus oder e Circuit Breaker fir de ganze Maart op engem Symbol annoncéiert, dat Dir hält. Et behandelt d'Spärung vun Uerder, d'Erweiderung vu Risikolimiten an eng Notional-skalaéiert Proxy-Absécherung, déi de Basisrisiko berücksichtegt. Wärend engem Maartstopp gëtt keng Proxy-Absécherung gemaach.

Add to TypingMind

Iwwersiicht

EditeurHimanshuJ16
RepositoryAlgo-Trading-Skills
Skill-Nummblack-swan-playbook-for-halted-markets
Stären
50
Forks
7
Matgeliwwert Dateien
5
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    HimanshuJ16 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Black Swan Playbook For Halted Markets an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/black-swan-playbook-for-halted-markets
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/black-swan-playbook-for-halted-markets .claude/skills/black-swan-playbook-for-halted-markets
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Black Swan Playbook For Halted Markets an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Black Swan Playbook For Halted Markets automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Black Swan Playbook For Halted Markets net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

When to Use

Invoke this skill during Black Swan events, elevated market volatility, or whenever an exchange disseminates a HALTED_LULD or HALTED_CIRCUIT_BREAKER status for traded symbols. Standard "Gaussian" risk models and naïve algorithmic retries fail catastrophically during microstructure breakdowns. This skill automates the institutional response:

  1. Avoiding trapped capital by cancelling pending limit/stop orders.
  2. Expanding risk parameters for extreme volatility regimes.
  3. Deploying notional-scaled proxy hedges (filtered by basis risk) to protect delta while the primary asset is frozen — but only when a proxy is actually tradable.
  4. Intelligently liquidating or rebalancing positions during re-opening auctions at model-derived fair value.

When NOT to Use

  • During a market-wide circuit breaker, for hedging purposes. The engine still performs order lockdown and risk-limit expansion, but it deliberately emits no proxy hedge: a US MWCB halts every NMS security (including SPY/QQQ) and CME coordinates a simultaneous halt of all US-based equity index futures and options, so no proxy exists to trade. HaltedMarketReport.hedge_suppression_reason records this.
  • Outside US NMS equities, without re-deriving the mechanics. LULD and MWCB thresholds, durations and reopening procedures are US-specific; other venues (NSE/BSE, Eurex, JPX, ASX) use different price-band and auction regimes.
  • As a fill-aware position manager. The engine emits intents, not executions. Reconciling fills, partial fills and rejects is the execution layer's job.

Prerequisites

  • Real-time Exchange Feed Status Notifications (HALT, RESUME, RESUME_AUCTION, PRE_OPEN).
  • Quantified correlation map identifying liquid proxy instruments (e.g. ETFs, index futures) and their return betas (r_asset = beta * r_proxy) relative to portfolio constituents.
  • Current prices for both legs — the halted asset's last trade / pre-halt reference price and the live proxy price. Without both, hedge size cannot be made notional-correct and the engine refuses to hedge.
  • Basis risk metrics to disable hedges when proxy correlations structurally break down.
  • A Fair-Value pricing model for the halted asset to determine optimal auction participation prices.

Workflow

  1. Detect Trading Halt Event: Engine receives a Halt signal (status, halt_reason, symbol). Structurally invalid events (empty symbol, non-finite position, non-MarketStatus status) raise ValueError rather than being silently absorbed.
  2. Microstructure Lockdown: Cancel all open orders for the halted symbol to prevent adverse selection upon un-halt — resting orders survive a US halt in the book and remain eligible for the reopening auction. Orders carrying a foreign symbol are excluded from the cancel set. Expand local VaR thresholds for the fat-tail environment.
  3. Classify the halt before hedging:
    • If the halt is market-wide (HALTED_CIRCUIT_BREAKER), suppress hedging entirely and record the reason — the proxy is halted too.
    • If a hedge is already working for this symbol, do nothing further; exchanges re-disseminate halt status and a second message must not fire a second hedge.
  4. Dynamic Proxy Hedging (single-name pauses only):
    • Reject unusable inputs first — a NaN basis-risk reading must fail closed, because NaN > limit evaluates to False.
    • Check that current basis risk does not exceed the configured limit for that proxy pair.
    • Size on beta-adjusted notional, not share count: ProxyUnits = Position × Beta × (AssetPrice / ProxyPrice). A negative beta (inverse proxy) flips the hedge direction.
    • Fire a PROXY_HEDGE order offsetting the held position's beta-adjusted delta, and record the exact instrument, size and side for the unwind.
  5. Auction Resumption:
    • Upon a RESUME_AUCTION or PRE_OPEN signal, compute the asset's estimated fair value.
    • Inject an AUCTION_RESUME_ORDER (limit) at fair value. If no usable fair value is available, skip auction participation rather than send an unpriced order into a reopening cross.
    • Issue the PROXY_HEDGE_UNWIND unconditionally whenever the symbol is resuming — including on a direct transition to NORMAL — so the hedge is never orphaned by a missing fair value or a flat position.

Full procedure: see references/workflows.md. Standards reference: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Proxy hedging through a market-wide circuit breaker: An MWCB halt covers all NMS securities and, by coordinated CME halt, all US-based equity index futures and options. A SELL QQQ hedge routed during a Level 1/2 halt cannot execute; if the router queues it, it fires blind into the reopen at an unknown price. Classify the halt before hedging.
  • Sizing a beta hedge in share count: Position × Beta is only correct when the asset and proxy trade at the same price. A 1,000-share position in a $450 stock hedged with a $375 ETF at beta 1.5 needs 1,800 proxy units, not 1,500 — a 17% under-hedge from omitting the price ratio.
  • Risk gates that fail open on NaN: float('nan') > basis_risk_limit is False, so a naive comparison passes a stale or corrupt basis-risk reading straight through and deploys the hedge it was meant to block. Validate for finiteness explicitly.
  • Orphaning the hedge: Nesting the unwind inside the auction-order branch means that whenever fair value is unavailable or the position is flat, the proxy hedge stays working after the halted name resumes — converting a hedge into naked directional exposure in the proxy.
  • Treating repeated halt messages as new halts: Exchange status is re-disseminated. Non-idempotent handling fires a second hedge while recording only one, so the eventual unwind is undersized and residual proxy exposure survives the event. The engine's guard is deliberately coarse — it keeps the first hedge and will not resize it if a late fill report changes the position after the hedge was placed; a desk needing that must compute and route the delta adjustment itself.
  • Unwinding on submission rather than on fill: This engine emits the auction order and the unwind together. If the auction limit order does not fill, the position is left unhedged. Production systems should trigger the unwind from the auction fill notification, not from order entry.
  • Assuming a reopening auction always follows: A Level 3 (20%) MWCB closes the market for the remainder of the day. There is no reopen to participate in, and the position carries overnight with the hedge decision already made.
  • Ignoring Basis Risk: Deploying a proxy hedge when the proxy instrument itself is decoupling from historical correlations, exacerbating losses instead of muting them.
  • Spamming Orders During Halt: Continuing to send execution API requests, leading to broker throttling, limits, or outright account suspension.
  • Static Risk Limits: Using static Value-at-Risk (VaR) or stop-loss limits during Black Swans. High volatility will instantly blow through these, triggering cascading liquidations. Dynamic, volatility-adjusted limits are required.

Verification

  • Inject a HALTED_LULD event on a 1,000-share long at 450.00 with a beta-1.5 proxy at 375.00. Verify order cancellation (with order IDs), risk limit adjustment, and a SELL 1800 QQQ proxy hedge — the notional-correct size, not 1,500.
  • Inject a high basis-risk scenario, then a NaN basis-risk scenario; confirm the proxy hedge aborts in both and hedge_suppression_reason is populated.
  • Inject a HALTED_CIRCUIT_BREAKER event; confirm lockdown occurs but no PROXY_HEDGE action is emitted.
  • Re-send the same HALTED_LULD event; confirm no second hedge order and an unchanged active_hedges entry.
  • Inject a resume event with no fair value; confirm no auction order but a full-size PROXY_HEDGE_UNWIND.
  • Run python -m unittest discover -s skills/black-swan-playbook-for-halted-markets/scripts and confirm 100% pass rate.

Related Skills

  • greeks-based-portfolio-hedging-automation
  • vendor-outage-fallback-data-source-hierarchy
  • kill-switch-and-drawdown-circuit-breakers
  • tail-risk-hedging-with-options
  • execution-algo-behavior-under-halted-instrument

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Black Swan Playbook For Halted Markets?

Benotzt dëst, wann eng Handelsplaz eng LULD-Paus oder e Circuit Breaker fir de ganze Maart op engem Symbol annoncéiert, dat Dir hält. Et behandelt d'Spärung vun Uerder, d'Erweiderung vu Risikolimiten an eng Notional-skalaéiert Proxy-Absécherung, déi de Basisrisiko berücksichtegt. Wärend engem Maartstopp gëtt keng Proxy-Absécherung gemaach.

Firwat Black Swan Playbook For Halted Markets op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Black Swan Playbook For Halted Markets besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Black Swan Playbook For Halted Markets an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/black-swan-playbook-for-halted-markets an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Black Swan Playbook For Halted Markets benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Black Swan Playbook For Halted Markets benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Black Swan Playbook For Halted Markets domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Black Swan Playbook For Halted Markets gratis?

Jo. HimanshuJ16 huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇