Logo di Broker Order Type Capability Matrix

Broker Order Type Capability Matrix

Community
HimanshuJ16
broker-order-type-capability-matrix

Use when one strategy runs across brokers with different native order types (bracket, OCO, trailing stop, iceberg, peg, TWAP) and must decide whether to send a native type or emulate it locally while conserving the parent quantity.

Panoramica

Pubblicato daHimanshuJ16
RepositoryAlgo-Trading-Skills
Nome della skillbroker-order-type-capability-matrix
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 Broker Order Type Capability Matrix 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/broker-order-type-capability-matrix
  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/broker-order-type-capability-matrix .claude/skills/broker-order-type-capability-matrix
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Broker Order Type Capability Matrix 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 Broker Order Type Capability Matrix 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 Broker Order Type Capability Matrix 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 deploying algorithmic strategies across broker APIs whose native order-type support differs. IBKR exposes bracket orders, OCA groups, iceberg via displaySize and the TWAP/VWAP IBALGOs; Alpaca exposes bracket and OCO order classes but no iceberg and no execution algos; Zerodha withdrew bracket orders but offers a native iceberg variety; Binance Spot covers OCO, OTOCO and icebergQty but reaches TWAP only through a separate Algo API. Submitting an unsupported type gets it rejected. This skill checks native support first and, where it is missing, decomposes the order into a primary leg plus explicitly typed legs for a local Execution Management System.

The two things it must get right, because everything downstream trusts them: the quantity conservation (does the plan execute exactly the requested size?) and the price geometry (are the protective legs on the side of the market that protects?).

When NOT to Use

  • As an EMS. scripts/capability_matrix.py plans an order. It performs no network I/O, submits nothing, watches no quotes and holds no state. The trigger watching, the timers, the sibling cancellation and the persistence are all yours.
  • As a live source of broker truth. DEFAULT_CAPABILITIES is a dated, sourced template. Support changes and varies by asset class, product and entitlement — re-verify against references/standards.md's links before trading it.
  • For VWAP, pegged, trailing-stop or auction orders the broker lacks. These are refused, not approximated. Emulating VWAP as evenly spaced slices yields a TWAP benchmarked against the wrong number. See the Related Skills.
  • As a substitute for idempotency. The plan tells you to fire one primary order; making sure a retry does not fire it twice is order-placement-idempotency.
  • Where a native path exists. An emulated OCO is strictly worse than the venue's own: local triggers add latency, a failure domain, and real double-execution risk.

Prerequisites

  • Each target broker's documented order-type surface — the API reference, not the four types you happened to test. references/standards.md lists them with sources.
  • A local EMS that can watch Level 1 quotes, run interval timers, cancel a sibling leg on trigger, and persist emulated legs across a restart.
  • The venue's minimum order size and quantity step per instrument, for min_slice_qty and for rounding the slice schedule before dispatch.

Workflow

  1. Register capability profiles, and make them self-consistent. The supports_* booleans are a view of native_order_types, not a second switch — a profile where they disagree raises at construction rather than reaching order time claiming native OCO while silently taking the emulation path.

  2. Validate before deciding how to route. plan_order_execution checks quantity, prices, leg completeness and price geometry ahead of the native/emulated branch. A bracket with no exit legs, or with the stop on the profitable side, is malformed regardless of whether the broker would have accepted it — the native path is not a validation bypass. Arguments the requested type does not consume are refused by name rather than discarded: a stop_loss_price silently dropped from a MARKET order leaves the caller believing a position is protected that nothing is watching.

  3. Read action per order type — they are not the same. For BRACKET it is the entry side and the exits invert it. For OCO it is the side of both exit legs, matching the same-side constraint Binance and Alpaca document for their native OCOs. BRACKET+BUY therefore wants the target above the stop, and OCO+BUY (closing a short) wants it below.

  4. Execute the plan exactly as written. If has_primary_order, fire primary_quantity of primary_order_type at primary_price once; then register emulated_legs. primary_quantity plus every scheduling leg's quantity already equals the requested quantity — do not re-slice the parent. When primary_order_type is None (emulated OCO), fire nothing now.

  5. Persist before you submit. plan.to_dict() serializes the plan losslessly. Write it down before the primary order goes out, not after.

Full procedure, EMS contract and the price-geometry table: see references/workflows.md. Per-broker capability evidence with sources: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Firing the primary slice and a feeder sized for the whole parent order. If the feeder's quantity is the full parent quantity while the primary is already the first slice, an EMS following the contract executes quantity + one slice — a 100-unit iceberg in 3 slices sends 133. The feeder here carries only what the primary did not.
  • Slicing in binary float. Ten thousand units in seven slices, summed, is not ten thousand units. The residue is tiny and the consequences are not: the final slice can be rejected for exceeding the parent's remaining quantity, or leave dust.
  • Assuming emulated OCO atomicity. One leg can fill on the exchange while the local cancel of the sibling is still in flight — both execute. Even IBKR's native OCA only removes this risk with an ocaType "with block", which routes one order at a time; ocaType=3 carries the same exposure a local emulation does.
  • Naming the unsupported type as the primary order. An emulated OCO whose plan reports primary_order_type=OCO sends the caller back to the exact endpoint that just failed the native-support check.
  • Exit legs on the wrong side of the market. A "protective" stop above a long entry is already through its trigger when the EMS registers it — it does not protect the position, it closes it instantly at a loss.
  • Falsy-checking a price. if not stop_loss_price reads 0 as "not supplied" and plans a bracket with a silently missing leg instead of rejecting a bad price.
  • Iceberg slices below the venue floor. Zerodha's iceberg takes 2–50 legs; Binance enforces LOT_SIZE and a minimum notional. A slice below the floor is a guaranteed rejection — pass min_slice_qty so the plan fails at planning time.
  • Slicing a market order and calling it an iceberg. An iceberg is a resting limit order with a restricted display size; market slices sweep the book instead. This is why the venues offering it natively attach it to limit orders.
  • Treating "native TWAP" as unconditional. Binance's TWAP lives only on the Algo endpoints, bounded by duration and notional; IBKR's TWAP/VWAP IBALGOs are documented for US equities. Both are "native" and neither is universal.
  • Losing emulated state. If the EMS restarts without its legs, the emulated stops never fire and nothing raises an error — the position is simply unprotected.

Verification

  • Run the unit suite and confirm every test passes: python -m unittest discover -s skills/broker-order-type-capability-matrix/scripts
  • Assert quantity conservation for an indivisible size: plan a 1000-unit TWAP in 7 slices and check primary_quantity + sum(metadata["slice_schedule"]) equals exactly 1000. This is the highest-value single assertion in the suite.
  • Assert an emulated OCO reports primary_order_type is None and has_primary_order is False.
  • Assert an inverted bracket (stop above target on a long) raises on the native path too, not just the emulated one.
  • Assert BRACKET+BUY and OCO+BUY accept opposite price orderings.
  • Assert a 0 price is rejected rather than treated as absent.
  • Assert min_slice_qty rejects a schedule whose slices fall below the venue floor.
  • Assert BrokerOrderCapabilityMatrix(custom_matrix={}) resolves no brokers at all.
  • Spot-check each profile in references/standards.md against the broker's live documentation before promoting to live trading.

Related Skills

  • broker-agnostic-adapter-interface
  • order-placement-idempotency
  • execution-algo-twap-vwap-slicing
  • iceberg-order-native-broker-support-vs-simulation
  • minimum-fill-size-and-lot-rounding-logic
  • paper-to-live-promotion-checklist

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 Broker Order Type Capability Matrix?

Use when one strategy runs across brokers with different native order types (bracket, OCO, trailing stop, iceberg, peg, TWAP) and must decide whether to send a native type or emulate it locally while conserving the parent quantity.

Perché usare Broker Order Type Capability Matrix su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Broker Order Type Capability Matrix è 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 Broker Order Type Capability Matrix in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/broker-order-type-capability-matrix. 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 Broker Order Type Capability Matrix?

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 Broker Order Type Capability Matrix?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Broker Order Type Capability Matrix: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Broker Order Type Capability Matrix è 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 👇