Logo: Broker Order Type Capability Matrix

Broker Order Type Capability Matrix

Communautéit
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.

Iwwersiicht

EditeurHimanshuJ16
RepositoryAlgo-Trading-Skills
Skill-Nummbroker-order-type-capability-matrix
Stären
50
Forks
7
Matgeliwwert Dateien
5
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    HimanshuJ16 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Broker Order Type Capability Matrix an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/broker-order-type-capability-matrix
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Broker Order Type Capability Matrix an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Broker Order Type Capability Matrix automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Broker Order Type Capability Matrix net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Broker Order Type Capability Matrix op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Broker Order Type Capability Matrix besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Broker Order Type Capability Matrix an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/broker-order-type-capability-matrix an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Broker Order Type Capability Matrix benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Broker Order Type Capability Matrix benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Broker Order Type Capability Matrix domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Broker Order Type Capability Matrix gratis?

Jo. HimanshuJ16 huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇