Логотип Calendar Spread And Multi Leg Order Atomicity

Calendar Spread And Multi Leg Order Atomicity

Сообщество
HimanshuJ16
calendar-spread-and-multi-leg-order-atomicity

Используйте этот навык для исполнения многокомпонентной стратегии на площадке без встроенного комбинированного инструмента, чтобы управлять риском разнесённого исполнения: один компонент исполняется, а рынок меняется до исполнения другого. Встроенный спред-инструмент устраняет эту необходимость.

Обзор

ИздательHimanshuJ16
РепозиторийAlgo-Trading-Skills
Название навыкаcalendar-spread-and-multi-leg-order-atomicity
Звёзды
50
Форки
7
Файлы в комплекте
5
ЛицензияApache-2.0
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

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

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

  • Открытый исходный код

    Издатель навыка на GitHub — HimanshuJ16. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Calendar Spread And Multi Leg Order Atomicity в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/calendar-spread-and-multi-leg-order-atomicity
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
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/calendar-spread-and-multi-leg-order-atomicity .claude/skills/calendar-spread-and-multi-leg-order-atomicity
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Calendar Spread And Multi Leg Order Atomicity в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Calendar Spread And Multi Leg Order Atomicity, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Calendar Spread And Multi Leg Order Atomicity не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

When to Use

Invoke this skill when executing multi-leg derivatives strategies (e.g., selling near-month, buying far-month options) across exchanges that lack native "combo" or "spread" order types. Executing these legs independently exposes the portfolio to Legging Risk—where one leg is filled but the market moves away before the second leg fills, leaving the portfolio with unintended directional Delta risk.

When NOT to Use

  • A native combination instrument exists. CME Globex lists calendar spreads as tradable instruments in their own right and its implied-order engine matches spread and outright books together "without the risk to the trader/broker of being double filled or filled on one leg and not on the other leg." Eurex, Deribit and most listed-derivatives venues offer equivalent combo/strategy books. Native combos give exchange-guaranteed atomicity; this skill only approximates it. Always check for a native instrument first — see assets/checklist.md.
  • The legs are not simultaneously tradable (different sessions, one leg halted, one leg pre-open). Algorithmic legging cannot mitigate a leg that has no market at all; see execution-algo-behavior-under-halted-instrument.
  • You have no reliable order-terminal-state feed. This engine's legging-risk detection depends on being told when the hedge order finished, not merely when it filled. Without that event, a zero-fill hedge is indistinguishable from a hedge still working.

Prerequisites

  • Two or more correlated instruments forming a spread strategy.
  • A live connection to a broker API that provides order-status callbacks for both fills and terminal order states (cancelled / expired / rejected).
  • A predefined maximum allowable "slippage" tolerance for the net spread price.

Workflow

  1. Spread Definition: Define the target net spread price and the limit prices for individual legs. Validate leg ratios and prices up front — a zero or negative ratio is a sizing bug that would otherwise surface as a division error mid-execution.
  2. Anchor Leg Execution: The engine places a limit order for the most illiquid leg first (the "anchor" leg). Starting an already-started engine is refused, because a re-entry would duplicate a live order on the venue.
  3. Triggered Execution: Upon a partial or full fill of the anchor leg, the engine immediately fires an IOC (Immediate or Cancel) order for the hedging leg, sized to that specific fill so the leg ratio is preserved tranche by tranche. The IOC is priced at the far edge of the configured slippage tolerance, so the tolerance is expressed once in the limit price rather than by chasing the market with repeated re-prices.
  4. Legging Risk Assessment: Evaluate the hedge only when the hedge order reaches a terminal state, never on a fill report alone. An IOC may emit several execution reports before its remainder is cancelled, so an early shortfall is not yet a break; conversely a hedge that fills nothing emits no fill report at all, and a fill-driven check would stay silent on the worst possible outcome — a fully naked anchor position.
  5. Break Handling: If the terminated hedge leaves an unhedged quantity, transition to BROKEN, raise a critical alert for the firm's emergency hedge protocol, and cancel the resting anchor order so naked exposure stops growing. If no cancel path is wired up, the engine escalates that fact explicitly rather than failing quietly.

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

Common Pitfalls

  • Market Order Hedging: Using Market Orders to complete the second leg guarantees execution but opens the strategy to catastrophic slippage during flash crashes.
  • Executing the Liquid Leg First: Filling the highly liquid leg first, then finding out the illiquid leg has no bids. Always execute the illiquid leg first.
  • Ignoring Partial Fills: Failing to proportionately size the second leg based on the partial fill quantity of the first leg.
  • Treating a partial hedge fill as a broken spread: An IOC that trades against three resting orders produces three execution reports. Declaring BROKEN on the first one both fires a false emergency and — because BROKEN is terminal — permanently ignores the fills that complete the hedge moments later.
  • Detecting legging risk from fill events only: The dangerous case is the hedge that fills zero. It sends no fill callback, so a fill-driven state machine leaves the position naked and the state machine reporting "hedging" forever. Subscribe to terminal order states.
  • Leaving the anchor order resting after a break: A passive anchor limit order keeps working after the hedge fails. Every subsequent fill adds unhedged exposure to a position you have already declared broken.
  • Float equality on quantities: 0.1 + 0.2 < 0.3 in binary floating point. Comparing accumulated fractional fill quantities exactly will manufacture phantom broken spreads on crypto and other fractional-size venues; compare with a tolerance.

Verification

  • Simulate an illiquid anchor leg filling 50%, followed by the hedging leg filling 50%. Ensure the remaining 50% anchor leg is managed correctly.
  • Simulate a hedge IOC that reports two partial fills totalling the full quantity, and one that reports no fills at all. The first must complete; the second must break and cancel the anchor.
  • Compare realized_net_spread() (anchor VWAP minus hedge VWAP) against the target net spread to confirm the executed spread landed inside tolerance.
  • Run python -m unittest discover -s skills/calendar-spread-and-multi-leg-order-atomicity/scripts and confirm 100% pass rate.

Related Skills

  • execution-algo-behavior-under-halted-instrument
  • smart-order-routing-across-venues
  • multi-leg-strategy-margin-optimization
  • order-placement-idempotency

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Calendar Spread And Multi Leg Order Atomicity?

Используйте этот навык для исполнения многокомпонентной стратегии на площадке без встроенного комбинированного инструмента, чтобы управлять риском разнесённого исполнения: один компонент исполняется, а рынок меняется до исполнения другого. Встроенный спред-инструмент устраняет эту необходимость.

Зачем использовать Calendar Spread And Multi Leg Order Atomicity в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Calendar Spread And Multi Leg Order Atomicity — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Calendar Spread And Multi Leg Order Atomicity в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/calendar-spread-and-multi-leg-order-atomicity. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Calendar Spread And Multi Leg Order Atomicity?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Calendar Spread And Multi Leg Order Atomicity?

С любым количеством. В TypingMind вы можете использовать Calendar Spread And Multi Leg Order Atomicity с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Calendar Spread And Multi Leg Order Atomicity?

Да. Навык опубликован на GitHub по лицензии Apache-2.0. Издатель — HimanshuJ16. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇