Logo Capital Efficiency Across Cross Margined Strategies

Capital Efficiency Across Cross Margined Strategies

Cộng đồng
HimanshuJ16
capital-efficiency-across-cross-margined-strategies

Dùng khi nhiều chiến lược cùng sử dụng một tài khoản ký quỹ theo danh mục đầu tư và bạn cần ước tính việc ký quỹ chéo giải phóng được bao nhiêu tài sản thế chấp so với ký quỹ riêng từng phần danh mục, bằng cách áp dụng các khoản bù trừ chênh lệch kiểu SPAN.

Add to TypingMind

Tổng quan

Nhà phát hànhHimanshuJ16
Kho mãAlgo-Trading-Skills
Tên kỹ năngcapital-efficiency-across-cross-margined-strategies
Sao
50
Bản fork
7
Tệp đi kèm
5
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được HimanshuJ16 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Capital Efficiency Across Cross Margined Strategies trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-efficiency-across-cross-margined-strategies
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Capital Efficiency Across Cross Margined Strategies trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Capital Efficiency Across Cross Margined Strategies ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Capital Efficiency Across Cross Margined Strategies với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Capital Efficiency Across Cross Margined Strategies làm được gì?

Dùng khi nhiều chiến lược cùng sử dụng một tài khoản ký quỹ theo danh mục đầu tư và bạn cần ước tính việc ký quỹ chéo giải phóng được bao nhiêu tài sản thế chấp so với ký quỹ riêng từng phần danh mục, bằng cách áp dụng các khoản bù trừ chênh lệch kiểu SPAN.

Vì sao nên dùng Capital Efficiency Across Cross Margined Strategies trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Capital Efficiency Across Cross Margined Strategies là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Capital Efficiency Across Cross Margined Strategies trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/capital-efficiency-across-cross-margined-strategies. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Capital Efficiency Across Cross Margined Strategies?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Capital Efficiency Across Cross Margined Strategies với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Capital Efficiency Across Cross Margined Strategies với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Capital Efficiency Across Cross Margined Strategies có miễn phí không?

Có. Kỹ năng này được HimanshuJ16 phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇