Logo van Black Swan Playbook For Halted Markets

Black Swan Playbook For Halted Markets

Community
HimanshuJ16
black-swan-playbook-for-halted-markets

Gebruik dit wanneer een handelsplatform een LULD-pauze of marktbrede circuit breaker afkondigt voor een symbool dat je in bezit hebt. Behandelt het blokkeren van orders, het verhogen van risicolimieten en proxyhedging op basis van notional en rekening houdend met basisrisico, zonder proxyhedge tijdens een marktbrede handelsstop.

Add to TypingMind

Overzicht

UitgeverHimanshuJ16
RepositoryAlgo-Trading-Skills
Skillnaamblack-swan-playbook-for-halted-markets
Sterren
50
Forks
7
Meegeleverde bestanden
5
LicentieApache-2.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 5

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door HimanshuJ16 op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Black Swan Playbook For Halted Markets in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/black-swan-playbook-for-halted-markets
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die 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 na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Black Swan Playbook For Halted Markets in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Black Swan Playbook For Halted Markets automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Black Swan Playbook For Halted Markets niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Black Swan Playbook For Halted Markets?

Gebruik dit wanneer een handelsplatform een LULD-pauze of marktbrede circuit breaker afkondigt voor een symbool dat je in bezit hebt. Behandelt het blokkeren van orders, het verhogen van risicolimieten en proxyhedging op basis van notional en rekening houdend met basisrisico, zonder proxyhedge tijdens een marktbrede handelsstop.

Waarom Black Swan Playbook For Halted Markets gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Black Swan Playbook For Halted Markets bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Black Swan Playbook For Halted Markets in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/black-swan-playbook-for-halted-markets. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Black Swan Playbook For Halted Markets gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Black Swan Playbook For Halted Markets gebruiken?

Zoveel als je wilt. Je kunt Black Swan Playbook For Halted Markets gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Black Swan Playbook For Halted Markets gratis?

Ja. Deze skill is door HimanshuJ16 op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇