Borsa Istanbul Api Integrationのロゴ

Borsa Istanbul Api Integration

コミュニティ
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.

概要

公開者HimanshuJ16
リポジトリAlgo-Trading-Skills
スキル名borsa-istanbul-api-integration
スター
50
フォーク
7
同梱ファイル
5
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    HimanshuJ16がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Borsa Istanbul Api Integration」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/borsa-istanbul-api-integration
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをその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/borsa-istanbul-api-integration .claude/skills/borsa-istanbul-api-integration
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでBorsa Istanbul Api Integrationを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にBorsa Istanbul Api Integrationを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Borsa Istanbul Api Integrationは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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.

TypingMindでBorsa Istanbul Api Integrationを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Borsa Istanbul Api Integrationはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにBorsa Istanbul Api Integrationをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/borsa-istanbul-api-integrationを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Borsa Istanbul Api Integrationを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Borsa Istanbul Api Integrationで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもBorsa Istanbul Api Integrationを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Borsa Istanbul Api Integration」は無料ですか?

はい。HimanshuJ16がApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇