Skip to content

Add IB Overnight time and sales support#31

Open
gorshkovga wants to merge 3 commits into
johnpantini:mainfrom
gorshkovga:feature/ib-time-and-sales
Open

Add IB Overnight time and sales support#31
gorshkovga wants to merge 3 commits into
johnpantini:mainfrom
gorshkovga:feature/ib-time-and-sales

Conversation

@gorshkovga

Copy link
Copy Markdown
Contributor

Описание

Поддержка ленты сделок (time and sales) для трейдера Interactive Brokers в overnight-сессии.

Изменения

Gateway (ib-gateway.mjs, @Version 13):

  • reqTickByTick / cancelTickByTick через двунаправленные WebSocket-сообщения
  • State machine для отложенной отмены подписки (pending → active → pending-cancel) — идентична market depth, защита от zombie-подписок
  • cancelAllTickByTick при закрытии WebSocket
  • getHistoricalTicksLast через HTTP для загрузки истории сделок

Trader (ib.js):

  • Новый класс MarketPrintDatum для датума MARKET_PRINT
  • Подписка с exchange OVERNIGHT для получения данных Blue Ocean ATS
  • Фильтр по overnight-сессии (UTC-часы с учётом DST)
  • Debounce 15.5 сек между подписками на один инструмент (ограничение TWS API)
  • historicalTimeAndSales через HTTP — загрузка истории с endDateTime в формате UTC
  • Маппинг exchange: BLUEOCEAN→ OVER, для консистентности с данными стакана

UI (trader-ib.js):

  • CAPS_TIME_AND_SALES в дефолтных caps

Примечания

  • Добавлены данные только для overnight-сессии
  • IB не передаёт side (buy/sell) — поле остаётся пустым
  • Дебаунс необходим из-за лимита TWS API: 1 tick-by-tick запрос на инструмент в 15 секунд

@netlify

netlify Bot commented Apr 1, 2026

Copy link
Copy Markdown

Deploy Preview for johnpantini ready!

Name Link
🔨 Latest commit 34a4d18
🔍 Latest deploy log https://app.netlify.com/projects/johnpantini/deploys/69cd29b17a31cb00085d8662
😎 Deploy Preview https://deploy-preview-31--johnpantini.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Apr 1, 2026

Copy link
Copy Markdown

@gorshkovga is attempting to deploy a commit to the johnpantini's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant