Логотип Capital Efficiency Across Cross Margined Strategies

Capital Efficiency Across Cross Margined Strategies

Спільнота
HimanshuJ16
capital-efficiency-across-cross-margined-strategies

Використовуйте, коли кілька стратегій працюють в одному рахунку з портфельною маржею і потрібно оцінити, скільки застави вивільняє перехресна маржа порівняно з окремим маржуванням кожного сегмента портфеля, застосовуючи заліки за спредами на кшталт SPAN.

Add to TypingMind

Огляд

ВидавецьHimanshuJ16
РепозиторійAlgo-Trading-Skills
Назва навичкиcapital-efficiency-across-cross-margined-strategies
Зірки
50
Форки
7
Файли в пакеті
5
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 5

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: HimanshuJ16. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Capital Efficiency Across Cross Margined Strategies у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-efficiency-across-cross-margined-strategies
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Capital Efficiency Across Cross Margined Strategies в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Capital Efficiency Across Cross Margined Strategies, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Capital Efficiency Across Cross Margined Strategies не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

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

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Capital Efficiency Across Cross Margined Strategies?

Використовуйте, коли кілька стратегій працюють в одному рахунку з портфельною маржею і потрібно оцінити, скільки застави вивільняє перехресна маржа порівняно з окремим маржуванням кожного сегмента портфеля, застосовуючи заліки за спредами на кшталт SPAN.

Навіщо використовувати Capital Efficiency Across Cross Margined Strategies у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Capital Efficiency Across Cross Margined Strategies — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Capital Efficiency Across Cross Margined Strategies у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-efficiency-across-cross-margined-strategies. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Capital Efficiency Across Cross Margined Strategies?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Capital Efficiency Across Cross Margined Strategies?

Зі скількома забажаєте. У TypingMind ви можете використовувати Capital Efficiency Across Cross Margined Strategies із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Capital Efficiency Across Cross Margined Strategies?

Так. На GitHub цю навичку публікує HimanshuJ16 за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇