Logo di Capital Efficiency Across Cross Margined Strategies

Capital Efficiency Across Cross Margined Strategies

Community
HimanshuJ16
capital-efficiency-across-cross-margined-strategies

Da usare quando più strategie condividono un conto con margine di portafoglio e vuoi stimare quante garanzie libera il margine incrociato rispetto al calcolo del margine separato per ciascun comparto, usando i crediti per spread in stile SPAN.

Add to TypingMind

Panoramica

Pubblicato daHimanshuJ16
RepositoryAlgo-Trading-Skills
Nome della skillcapital-efficiency-across-cross-margined-strategies
Stelle
50
Fork
7
File inclusi
5
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 5

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da HimanshuJ16 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Capital Efficiency Across Cross Margined Strategies in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-efficiency-across-cross-margined-strategies
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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/capital-efficiency-across-cross-margined-strategies .claude/skills/capital-efficiency-across-cross-margined-strategies
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Capital Efficiency Across Cross Margined Strategies in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Capital Efficiency Across Cross Margined Strategies non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Capital Efficiency Across Cross Margined Strategies non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

When to Use

Invoke this skill when several strategies share one margined account and capital, not signal quality, is the binding constraint. Margining every sleeve standalone charges for risks the account does not actually carry: a long in one sleeve and a short in a related instrument in another partly cancel, and a portfolio-margin engine prices the residual rather than the sum.

Use it to answer two questions with a number rather than a hope: how much collateral does the offset plausibly release, and how much of that release survives a conservative assumption about the credit the broker will grant. The module reports the isolated total, the estimated cross-margined total, the Capital Efficiency Ratio between them, and a per-spread audit trail showing which credit produced which dollar.

When NOT to Use

  • As a substitute for the broker's margin number. This is an estimator with a published-parameter input, not a margin engine. OCC TIMS and CME SPAN revalue the book across a scenario grid; Bybit's Unified Trading Account uses stress-test results. Size positions against the broker's own calculator or margin API, and use this to plan.
  • To justify deploying the freed capital. The output is a capacity figure, not a recommendation. Freed collateral redeployed into correlated risk is the mechanism by which cross-margined books cascade when the correlation breaks.
  • Across venues. Positions at two exchanges do not offset — separate accounts at separate clearing organisations. Inter-clearing-house netting exists only inside formal cross-margin programmes; see cross-margining-across-asset-classes.
  • For a single-name equity book under US portfolio margin. OCC's Customer Portfolio Margin grants non-index single-stock class groups no offset at all, however correlated the names are. A correlation-derived estimate will be pure fiction there; pass an explicit credit rate of 0.0.
  • For per-contract accuracy on options. Real requirements are floored per contract ($0.375 x multiplier under TIMS, the short option minimum under SPAN). This model has no contract concept; use min_cross_margin_fraction to approximate the floor.

Prerequisites

  • Positions as (symbol, signed delta, standalone margin), one row per instrument. Rows from different strategy sleeves must be netted first — see step 1.
  • Ideally, the broker's or exchange's published offset percentages for the pairs you hold (SPAN inter-commodity credit tables, OCC product-group offsets, or the broker's margin documentation). A correlation matrix is the fallback when those are unavailable.
  • An account actually enabled for portfolio margining, and eligible for it: FINRA Rule 4210(g) sets minimum equity of $100,000 to $500,000 depending on the member's intraday monitoring capability, and IBKR requires $110,000 to open a portfolio-margin account and $100,000 to keep one.
  • If using correlations: a dated, documented estimation window. Correlation is an input you chose, not a fact about the future.

Workflow

  1. Net each instrument across sleeves before margining anything. Two sleeves holding BTC — one long, one short — are one net position to the broker, and the account is margined on the net. net_positions_by_symbol collapses them, scaling margin by the net delta at the group's highest margin rate and capping the result at the summed standalone margin so netting can never raise the requirement. calculate_margin raises on duplicate symbols rather than silently margining them as two spreadable legs.
  2. Prefer a published credit rate over a correlation. Pass credit_rate_overrides={'CORN': {'SOYB': 0.65}} where the exchange publishes the number; it is used as given and the haircut is not applied on top, because a published rate is already the post-haircut figure. Correlation is consulted only for pairs with no override.
  3. Treat the haircut as your conservatism, not a standard. correlation_haircut defaults to 0.80. No regulator or clearing house prescribes that figure — it exists because a raw historical correlation is the most optimistic number in the calculation.
  4. Read the spread audit trail, not just the total. Each OffsetCredit names the two legs, the rate, the amount spread and whether the rate was published or correlation. A total driven by correlation-sourced credits on pairs the broker groups separately is a total that will not survive contact with the margin engine.
  5. Floor the estimate before you plan against it. Set min_cross_margin_fraction to the smallest fraction of standalone margin you believe the broker could ever charge. floor_applied on the report tells you the floor, not the model, produced the answer.
  6. Compare CER against reality, then re-anchor. Reconcile the estimate against the broker's actual requirement on a live book. Persistent optimism means the credit rates are wrong; correct the rates rather than raising the haircut to compensate.

Full procedure: see references/workflows.md. Sourced methodology parameters: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Passing the same symbol twice. Two sleeves' BTC rows margined as two legs get a spread credit against each other instead of netting to flat — a genuinely flat book reporting $12,000 of requirement. This raises MarginInputError and points at net_positions_by_symbol.
  • Believing a correlation is a credit rate. Exchanges publish offset percentages as fixed parameters — SPAN's inter-commodity credit table, OCC's product-group offsets — set from their own analysis and revised on their schedule, not from your EWMA window.
  • Assuming correlation holds in the tail. A 0.95 correlation is a statement about the sample you measured. Margin engines apply their own conservatism precisely because the hedge that is supposed to fund the position is the one that fails in a dislocation.
  • Redeploying the freed collateral into more of the same risk. The offset assumed the legs cancel; doubling the book on the strength of it removes the cancellation that justified the credit, and liquidation cascades from there.
  • Expecting a 5x or 10x capital saving. Structurally impossible in this model: each spread consumes its credited amount from both legs, so the credit never exceeds half the isolated requirement and the ratio is bounded above by 2.0.
  • Netting across exchanges. A Binance long does not offset a Bybit short. Two accounts, two clearing organisations, two margin calls.
  • Crediting a negative correlation. A long and a short in negatively correlated instruments are risk-additive. No credit is granted; the inverse case — two same-side legs that genuinely hedge — is also uncredited, so the estimate is low on such books.
  • Letting bad data through. A correlation of 1.4 from a broken feed produced a requirement below the model's own floor and a CER of 3.33x. Out-of-range correlations, credit rates, haircuts, negative margins, NaN and infinity now raise MarginInputError.

Verification

  • Run the unit suite and confirm every test passes: python -m unittest discover -s skills/capital-efficiency-across-cross-margined-strategies/scripts
  • Long $100k of A against short $100k of B, each carrying $10,000 standalone margin, at a 0.90 correlation and a 0.80 haircut: the credit rate is 0.72, the credit is min(10000, 10000) * 0.72 = $7,200, cross margin is $12,800 and CER is 1.5625. A materially lower requirement than that is a bug, not a saving.
  • Shuffle the position list and confirm the requirement is unchanged. Spreads form highest-credit-first, so the number must not depend on arrival order.
  • Give one long two competing shorts and confirm the higher-credit spread forms first and consumes the long.
  • Net a long and an equal short of the same symbol and confirm the netted position carries zero delta and zero margin — then confirm passing both rows unnetted raises.
  • Pass a correlation of 1.4, a haircut of 1.5, a negative margin and a NaN delta, and confirm each raises MarginInputError. A number coming back is a fail-open bug.
  • Set a 100% credit rate on a matched pair and confirm CER is exactly 2.0, never infinity.
  • Reconcile against the broker's own margin figure on a live book before allocating against the freed capital.

Related Skills

  • cross-margining-across-asset-classes
  • options-margin-span-calculation-global
  • multi-leg-strategy-margin-optimization
  • margin-utilization-circuit-breaker
  • broker-account-margin-call-handling
  • broker-margin-interest-accrual-tracking
  • correlation-aware-exposure-limits

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Capital Efficiency Across Cross Margined Strategies?

Da usare quando più strategie condividono un conto con margine di portafoglio e vuoi stimare quante garanzie libera il margine incrociato rispetto al calcolo del margine separato per ciascun comparto, usando i crediti per spread in stile SPAN.

Perché usare Capital Efficiency Across Cross Margined Strategies su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Capital Efficiency Across Cross Margined Strategies è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Capital Efficiency Across Cross Margined Strategies in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-efficiency-across-cross-margined-strategies. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Capital Efficiency Across Cross Margined Strategies?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Capital Efficiency Across Cross Margined Strategies?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Capital Efficiency Across Cross Margined Strategies: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Capital Efficiency Across Cross Margined Strategies è gratuita?

Sì. È pubblicata su GitHub da HimanshuJ16 con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇