Borsa Istanbul Api Integration logo

Borsa Istanbul Api Integration

Community
HimanshuJ16
borsa-istanbul-api-integration

Use when routing orders to Borsa Istanbul BISTECH over FIX 5.0 SP2 and the order lifecycle must be modelled correctly: NewOrderSingle, the two possible answers to a cancel request, and execution reports applied idempotently across resends.

Overview

PublisherHimanshuJ16
RepositoryAlgo-Trading-Skills
Skill nameborsa-istanbul-api-integration
Stars
50
Forks
7
Bundled files
5
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by HimanshuJ16 on GitHub. Read the source before you install it.

Installation

Install the Borsa Istanbul Api Integration AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/borsa-istanbul-api-integration
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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/borsa-istanbul-api-integration .claude/skills/borsa-istanbul-api-integration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Borsa Istanbul Api Integration in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Borsa Istanbul Api Integration on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Borsa Istanbul Api Integration is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

When to Use

Use this skill when building order routing to Borsa Istanbul's BISTECH platform and you need the order lifecycle modelled correctly: NewOrderSingle (MsgType=D), Order Cancel Request (MsgType=F) and its two possible answers, and ExecutionReport (MsgType=8) application that survives resends.

BISTECH runs on Nasdaq's Genium INET technology. BIST offers FIX and OUCH for order entry and ITCH and TIP for market data; Borsa İstanbul states it supports FIX 5.0 SP2, and members must certify their software (or use a certified application) before production access.

When NOT to Use

  • As a FIX gateway. scripts/borsa_istanbul_api_integration.py is an in-memory order state machine with a simulated session layer. It opens no sockets, encodes and decodes no FIX messages, assigns no FIX sequence numbers, and persists nothing across restarts. connect() sets a flag. Use a real engine (QuickFIX or a BIST-certified application) for transport, and use this module to model the lifecycle and drive state from the reports that engine decodes.
  • For latency-sensitive order entry. BIST's low-level binary OUCH protocol exists for that; FIX is the broader-access, higher-overhead option. Do not benchmark a latency-critical path against a FIX design.
  • For market data. Order entry only. ITCH/TIP are separate protocols with separate certification.
  • As a substitute for certification. Passing these unit tests is not BISTECH certification and grants no production access.

Prerequisites

  • Python 3.10+.
  • A real FIX engine for transport, and network connectivity to BIST's FIX gateways or the BISTECH simulator environment.
  • Approved SenderCompID and TargetCompID issued by Borsa Istanbul.
  • BISTECH FIX certification for the market you are trading (required for production).
  • The BISTECH specification documents for your market. Message-level details, accepted TimeInForce values, required party/account tags and session phases are venue- and market-specific; this skill deliberately does not hard-code them.

Workflow

  1. Configure and establish the session. BISTConfig carries CompIDs, host, port and heartbeat interval. connect() validates them — an out-of-range port or an empty CompID is rejected before anything is attempted, because a FIX message without both CompIDs cannot log on.
  2. Build and submit the order. submit_order() refuses anything the venue or the protocol would reject: non-finite or non-positive quantity, a limit order without a positive price, a market order that carries a price (FIX forbids Price on OrdType=Market), an empty symbol, and — critically — a duplicate ClOrdID. Reusing a ClOrdID would overwrite a live order's record and discard its accumulated fills, so it raises rather than replacing.
  3. Apply fills as they arrive. simulate_execution_report(client_order_id, filled_qty, exec_price, exec_id=...) takes filled_qty as LastQty (this fill), not cumulative. Always pass exec_id. After a sequence gap the counterparty resends messages, and ExecID is the only thing distinguishing a resent report from a new one; without it a resend double-counts the fill and corrupts the average price.
  4. To cancel, send the request — then wait. cancel_order() sends an Order Cancel Request and moves the order to PENDING_CANCEL. The order is still live at the venue at this point and can still fill. Do not treat PENDING_CANCEL as cancelled, do not release its risk budget, and do not reuse its ClOrdID.
  5. Resolve the cancel on the venue's answer, not your own. An ExecutionReport with ExecType=Canceled → confirm_cancel(). An Order Cancel Reject (MsgType=9) → reject_cancel(), which returns the order to PARTIALLY_FILLED or NEW according to its fill state, because a rejected cancel means the order was never cancelled. The most common reason for a reject is that the order completed or was already inactive before the request landed.
  6. Treat a refused overfill as an incident, not a warning. If a report would push cumulative quantity past the order quantity, it is rejected and logged at ERROR. That means a duplicate escaped deduplication or the venue sent something impossible — reconcile against the venue before trading on the position.

Full session and order-routing sequence: see references/workflows.md. Protocol and symbology conventions: see references/standards.md. Pre-production readiness checklist: see assets/checklist.md.

Common Pitfalls

  • Treating an Order Cancel Request as a cancellation. MsgType=F requests cancellation of the remaining quantity. Until the venue answers with ExecType=Canceled or an Order Cancel Reject, the order is working and can fill. Marking it cancelled locally and then discarding subsequent execution reports as "terminal" silently loses real fills and leaves your position short of the venue's.
  • Applying execution reports without ExecID deduplication. Resend Request (MsgType=2) recovery is a normal part of FIX session management, and it replays application messages. A handler with no ExecID memory double-counts every replayed fill.
  • Accepting cumulative quantity beyond the order quantity. An overfill is never legitimate; absorbing it silently converts a message-handling bug into a phantom position and a wrong average price.
  • Reusing a ClOrdID. BIST requires it to be unique. Reuse makes the venue's reports ambiguous and, locally, overwrites the fill state of the order still working under that ID.
  • Validating quantity with qty <= 0 alone. NaN fails every comparison, so a NaN quantity passes that check and gets routed.
  • Sending Price on a market order. FIX forbids Price on OrdType=Market. Some gateways reject it, others silently ignore it and fill you at a price you did not intend.
  • Naive UTC timestamps. BIST operates on Europe/Istanbul time. Timestamps that carry no timezone silently misalign against venue timestamps in reconciliation and forensics.
  • Assuming this module manages FIX sequence numbers. It does not. Sequence assignment, gap fill, Resend Request handling and persistence across restarts belong to your FIX engine, and getting them wrong is its own failure mode.
  • Connecting to the wrong environment. Simulator and production differ in CompIDs, endpoints and TLS/VPN configuration; a config mix-up sends live orders from a test run.

Verification

  • Run the unit suite and confirm every test passes: python -m unittest discover -s skills/borsa-istanbul-api-integration/scripts
  • Assert the cancel-race invariant explicitly in your own integration: send a cancel request, deliver a fill before any venue answer, and confirm the fill is applied and the order remains PENDING_CANCEL. This is the defect that costs money; test it directly.
  • Replay a captured ExecutionReport twice with the same ExecID and confirm cumulative quantity and average price are unchanged.
  • Reconcile cumulative filled quantity and average price against the venue's own end-of-day trade file — the local state machine is only as good as the reports fed to it.
  • Run BIST's FIX certification scenarios against the BISTECH simulator before production. Unit tests do not substitute for certification.

Related Skills

  • fix-protocol-session-management-across-venues
  • broker-api-idempotent-cancel-requests
  • order-placement-idempotency
  • nasdaq-totalview-itch-feed-parsing
  • cme-stp-fix-and-ilink2-tag-value-encoding

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Borsa Istanbul Api Integration AI skill do?

Use when routing orders to Borsa Istanbul BISTECH over FIX 5.0 SP2 and the order lifecycle must be modelled correctly: NewOrderSingle, the two possible answers to a cancel request, and execution reports applied idempotently across resends.

Why use Borsa Istanbul Api Integration on TypingMind?

Because you install it once and use it with any model. Borsa Istanbul Api Integration is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Borsa Istanbul Api Integration in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/borsa-istanbul-api-integration. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Borsa Istanbul Api Integration?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Borsa Istanbul Api Integration?

As many as you like. As long as a model supports skills, you can use Borsa Istanbul Api Integration with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Borsa Istanbul Api Integration AI skill free?

Yes. It is published on GitHub by HimanshuJ16 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇