2.17

🌉 IBKR Live Bridge

Greeks, IV e bid/ask em tempo real no straderz.com

1. O que é a IBKR Live Bridge?

Com a IBKR Live Bridge, pode ver as suas opções abertas e dados de carteira com Greeks, Implied Volatility, Bid/Ask e P&L em tempo real diretamente no straderz.com — como complemento à sincronização diária via Flex Query.

O que vê no Live Cockpit:
  • Greeks ao vivo (Δ, Γ, Θ, V) para cada posição de opções aberta
  • Implied Volatility e Bid/Ask em tempo real
  • Portfolio Δ e Θ agregados em todas as posições — visível imediatamente quando o book fica demasiado long ou short
  • Saldo da conta e margem ao vivo
  • Cadeias de opções a pedido para análise what-if
Complementa — não substitui.
A Bridge funciona em paralelo com a sincronização Flex Query noturna. O Flex continua a ser a fonte de verdade para o histórico de negociações oficial (impostos, deteção de estratégias, campanhas). A Bridge fornece o caminho em tempo real para a gestão ativa de opções.
✨

Como funciona

A Live Bridge é uma pequena aplicação local no seu PC que comunica com o seu TWS ou IB Gateway em execução via a API IBKR e envia snapshots encriptados para o straderz.com. O seu login IBKR fica inteiramente na sua máquina — não recebemos nem a sua password nem os seus códigos 2FA.

[O seu PC]                                       [straderz.com]                              [Você no browser]
TWS / IB Gateway
    ↓ ib_insync TCP
[Live Bridge] ──── HTTPS POST ────►  [Servidor] ◄──── HTTPS GET ──── [Live Cockpit]
    │                                    │
    └─ lê posições,                      └─ armazena snapshots,
       Greeks, IV, Bid/Ask                   entrega-os ao seu browser
Fluxo de dados resumido:
  • Só leitura, sem negociação — a Bridge não coloca ordens. Envia apenas posições, Greeks, IV, Bid/Ask e saldo da conta.
  • Isolado por utilizador — cada snapshot está vinculado à sua conta via token OAuth; outros utilizadores nunca o veem.
  • Latência ~2 segundos do tick IBKR até à exibição no cockpit.
  • Push HTTPS com bearer token, polling ETag-based pelo browser para carga mínima de dados.

3. Requisitos

  • Windows 10 ou 11 — versão para Mac em preparação (ver nota abaixo)
  • Conta IBKR com TWS (Trader Workstation) ou IB Gateway em execução
  • API IBKR ativada — no TWS em Configuração → API → Definições, ativar "Enable ActiveX and Socket Clients"
  • Conta sTraderZ.com (gratuita ou Premium)
  • Opcional: subscrição de dados de mercado IBKR para dados ao vivo — ver "Subscrição de dados de mercado & cotações com atraso"
⏳ Versão Mac
A Bridge funciona atualmente apenas no Windows. Uma versão para Mac está em preparação — até lá, os utilizadores de Mac continuam a usar a sincronização Flex Query como caminho principal de dados.

Guia Passo a Passo

1

Instalação

1. Transferir a Bridge:
Transfira a Bridge a partir da página de downloads ou diretamente nas definições da Live Bridge.

2. Iniciar a Bridge:
Faça duplo clique em straderz-bridge.exe. Não abre nenhuma janela — a Bridge corre em segundo plano. O ícone da Bridge aparece na bandeja do sistema (canto inferior direito, junto ao relógio).

3. Executar TWS ou IB Gateway em paralelo:
Inicie o seu software IBKR habitual e inicie sessão. A Bridge deteta automaticamente o gateway em execução e liga-se a ele.
2

Emparelhar com o straderz.com

1. Iniciar o emparelhamento no straderz.com:
Vá a Contas → Live Bridge e clique em "Ligar ao straderz.com".

2. Diálogo de autorização no browser:
Abre-se uma página de confirmação com o nome da sua conta. Clique em "Ligar" — o fluxo OAuth é executado com PKCE, pelo que a Bridge nunca vê a sua password.

3. Verificar o estado na bandeja:
Clique no ícone da Bridge na bandeja. O estado deve mostrar ✅ ligado.

4. Primeiros dados no cockpit:
Mude para o Live Cockpit. Ao fim de alguns segundos as suas posições abertas aparecem com Greeks e IV ao vivo.

6. Multi-Conta: Pessoal, Empresa, Fundação em Paralelo

Se gerir várias contas IBKR — p. ex. conta pessoal + depósito empresarial + veículo de fundação — pode trazê-las todas para o cockpit ao vivo ao mesmo tempo.

Configuração:
Inicie múltiplas instâncias do IB Gateway em paralelo, cada uma na sua própria porta (p. ex. :7497 para pessoal, :7498 para empresa, :7499 para fundação). A Bridge deteta automaticamente todos os gateways e etiqueta cada posição com a conta correspondente.

No cockpit pode alternar entre contas ou ver uma vista agregada de todas as contas.

💡 Dica: A documentação oficial IBKR descreve a configuração de gateway paralelo em "IB Gateway User Guide → Running Multiple Instances". Use um login IBKR separado (subconta) para cada instância.
✨

Subscrição de dados de mercado & cotações com atraso

A Bridge utiliza a sua subscrição de dados de mercado IBKR existente — não é necessária uma segunda subscrição no straderz.com. Se pagar pelo "US Securities Snapshot and Futures Value Bundle" ou semelhante no IBKR, esses dados ao vivo fluem automaticamente para o cockpit.

Sem subscrição IBKR: A Bridge entrega apenas cotações com atraso de 15 minutos. Importante saber: isto aplica-se também à exibição no seu TWS. Sem subscrição, o IBKR fundamentalmente só entrega cotações com atraso, independentemente do frontend (TWS, Bridge, app móvel, outras apps de trading). A Bridge não altera isto.

Com subscrição IBKR: Dados ao vivo no TWS E no straderz.com simultaneamente. Vê os mesmos valores em tempo real que tem no TWS.

Recomendação para trading ativo de opções:
Pelo menos o "US Securities Snapshot and Futures Value Bundle" ou um pacote de dados de opções específico. Detalhes e preços atuais no Portal do Cliente IBKR em Definições → Definições de Utilizador → Subscrições de Dados de Mercado.

8. Operação

  • Execute a Bridge em segundo plano — ícone na bandeja, baixo uso de RAM, sem interface necessária.
  • Atualizações automáticas — a Bridge verifica novas versões no arranque. Se estiver disponível uma atualização, aparece um aviso no menu da bandeja.
  • Parar a Bridge — clique com o botão direito no ícone da bandeja → "Sair". O cockpit mostra então o último estado conhecido com o marcador "desatualizado".
  • Revogar ligação — em Contas → Live Bridge, clique em "Desligar". O token é imediatamente revogado no servidor e já não pode ser usado para snapshots.
  • Nota sobre 2FA (importante): Ative a "Extended Session" do IBKR, caso contrário terá de iniciar sessão no TWS a cada ~24 horas — e a Bridge fica inativa entretanto. Instruções na Gestão de Conta IBKR em Definições → Definições de Conta → Secure Login System.

⚠️ Resolução de Problemas

A bandeja mostra "Offline" ou "Sem ligação":
O TWS ou IB Gateway não está em execução, ou o socket da API não está ativado. Verifique os requisitos da secção 3.

"Emparelhamento falhou":
O token foi revogado ou expirou. Solução: nas definições da Live Bridge, clique em "Ligar ao straderz.com" e emparelhe novamente.

O cockpit mostra apenas cotações com atraso:
Sem subscrição de dados de mercado IBKR (ver "Subscrição de dados de mercado & cotações com atraso"). Com subscrição, os dados ao vivo são passados automaticamente.

"Atualizações não aparecem":
Verifique o estado da Bridge na bandeja. Se "ligado" é mostrado mas não chegam atualizações: reinicie o TWS ou IB Gateway — a ligação TCP pode ter ficado suspensa devido a alterações de rede (p. ex. WiFi/LAN).

A Bridge bloqueia ou congela:
Saia da Bridge na bandeja e reinicie-a. Em caso de bloqueios repetidos: está instalada a versão mais recente? Transfira a versão mais recente na página de downloads.

Ainda não tem conta IBKR configurada?
A Live Bridge requer que já tenha ligado a conta IBKR via Flex Query (para o histórico de negociações). → Capítulo 2.1 — Configurar IBKR Flex Query

10. TWS or IB Gateway?

The sTraderZ Bridge connects to either TWS (Trader Workstation) or IB Gateway. You need only one of the two; both give the sTraderZ Bridge the same data. IB Gateway is a separate program from Interactive Brokers: a pure interface without a trading screen, just a login and status window.

TWSIB Gateway
PurposeTrading platform with charts, order book and watchlists. Useful if you trade by hand there anyway.No trading screen; orders are possible only through programs via the API. Useful if the sTraderZ Bridge should read data and you do not trade in the program yourself.
ResourcesHeavy, needs a lot of memory and CPULight, runs quietly in the background
Always-on useLogs out regularly, then needs a new loginBuilt for always-on use, with automatic restart
API port7497 paper, 7496 live4002 paper, 4001 live
Enable the APIEdit → Global Configuration → API → SettingsConfigure → Settings → API → Settings
Downloadinteractivebrokers.comStable (recommended) or Latest
The port is not a firewall question.
If the sTraderZ Bridge reports "connection refused", nothing is listening on the port (e.g. 4001) because the API is still switched off in the program. You do not need to open anything in firewall or router as long as TWS or Gateway and the sTraderZ Bridge run on the same computer. Enable the API (menu path in the table), then click Apply and OK.

11. The "Date" column in the Live Cockpit

Next to the market data, the Live Cockpit shows in the Date column which earnings and dividend dates fall on a row within the next 14 days. The data comes from a separate, slower request (every 60 seconds) and does not disturb the price updates. If the source fails, the cockpit stays unchanged and the column shows a question mark.

  • E 19.11. – earnings. For options only a date before expiry counts. ~E means the date is not confirmed yet.
  • Ex 12.11. – ex-dividend day. For options only for positions with a call leg and only if the ex-date is not after expiry (early exercise possible).
  • +1 – there are more dates; the mouseover shows all of them.

The chip colour shows how close the date is to a position it affects: red for sold options in or near the money, yellow for other sold options, grey as plain information (e.g. stocks or bought options). There is deliberately no green: "no date" does not mean "checked and fine". The chips are orientation, not a recommendation to act.

On a phone the next date appears as a hint after the position name; the tooltip opens on tap. The column can be shown or hidden in the column selector.

More context elements. The Rule column shows whether one of your action rules has triggered for the position (symbol of the highest level, with a count from two rules). The Campaign column (off by default, switch it on in the column selector) shows the type and roll count of the matching campaign; it stays empty if the assignment is not unambiguous. The 👁️ button at the end of a row opens a detail panel with rules, dates and the campaign history; the live values keep updating inside it. The Risk tab starts with a scenario (a rough approximation from delta and gamma for an index move of −10%, −5%, +5% or +10%, with beta 1 for all underlyings, without volatility change or time decay; not a forecast) and then lists concentration (capital tied up per factor, across all web accounts), the dates of the next 14 days and rules without a row. The Campaigns tab shows open campaigns with realized (journal), open (live), fees and risk, separated by currency. Rules, concentration and campaigns are calculated on journal holdings while the table shows live data, so a trade opened just now may be missing briefly. Accounts in vault mode are not evaluated on the web.

12. Search roll options (roll search in the Live Cockpit)

For sold options the Live Cockpit shows the Roll chip. A click opens the detail panel and starts Search roll options: the bridge asks TWS for later expiries and strikes further out of the money and checks whether closing the old and opening the new position still gives a net credit (or at most the debit you set). The search places no orders and gives no recommendation.

What is checked. For each expiry (about 7, 14, 21, 28, 56 and 84 days after the current expiry, at most 100 days) the search starts at the current strike and moves strike by strike away from the money (puts down, calls up), at most 16 strikes per expiry. For spreads both legs keep their width and move the same amount; the outer wing must exist. For a covered call only the call leg is rolled.

Can be rolledCannot be rolled
Short put, short call, bull put spread, bear call spread, covered call (call leg)Long options, debit spreads, straddles, strangles, iron condors

Reading the matrix. Rows are strikes, columns are expiries (with days to expiry); the cells show the credit per share (for spreads per spread). Green is a credit, red a debit, a dot means "not queried" because the search had already stopped earlier in that expiry or the strike does not exist there. The strongly tinted cell is the furthest strike per expiry that still stays within the limit: a credit, or with a max debit above 0 also a debit up to that amount. If "…" appears below the last cell of an expiry, the search was cut off there before the end (time ran out or the bridge had another request); a note below the matrix names these expiries. A line below a strike marks the current price; the bar on the left marks the current strike. Above the matrix you see the buy-back cost (at the ask for short options) with quantity, the time of the snapshot and the price.

A click on a cell shows the detail line below: expiry and strike (with "+n d longer"), credit per share, total (credit × quantity × multiplier), the position delta after rolling and the OTM distance to the price in percent. Two buttons: Copy both legs puts the data of both legs on the clipboard, Open in the chain jumps to the option chain.

Bid/Ask or Mid. The switch selects the price basis. Bid/Ask uses the unfavourable price per leg (buy back at the ask, sell the new one at the bid); Mid uses the midpoint. The display stops at the first debit of the chosen basis. The Max debit field lets cells with a debit up to that amount per share still count as a hit (default 0.00).

Limits. The result is a snapshot with a time, not live; fees are not included. Outside market hours or without a market data subscription the search reports "no quote" or delayed quotes, and the numbers are uncertain. A second search right after the first is throttled. The roll search needs Bridge 1.4.0; with an older bridge a hint asks you to update it. The search quotes the contracts of the main trading class of the underlying. For adjusted options (for example after a corporate action, symbols like 1XYZ) or for SPX, where monthly options (SPX) and weekly options (SPXW) expire on the same day, the quotes can belong to a different contract than your position: check the result against the position in TWS. It is a calculation aid, not investment advice.

13. Prices of all accounts through one account (several IBKR accounts, one market data subscription)

If you connect several IBKR accounts to the sTraderZ Bridge over separate connections but only one of them has a market data subscription, the other accounts show delayed or no prices. A price belongs to the contract, not to the account. With the option Prices of all accounts through one account the bridge additionally fetches the prices of the positions of all accounts through the connection of the account with the subscription. If all accounts run under one IBKR login (linked accounts), you usually do not need the option: the bridge then says "All accounts run over one connection, so the option is not needed".

Switching it on. In the bridge, open the Accounts tab and click Prices of all accounts through one account .... The dialog lists all accounts with their current market data state and lets you choose the account with the subscription as the source. "Switch on" stays locked until you tick the mandatory box: All listed accounts belong to me, and my market data subscription may be used for them. You switch it off with one click in the same tab. The option is off by default. The switch exists only in the bridge, not on the web.

Licence. An IBKR market data subscription applies per person. It must not be used for accounts of other persons. With the box you confirm that all listed accounts belong to you and that your subscription may be used for them; the bridge cannot check this. This is not legal advice: the terms of IBKR apply.

What is shared and what is not.

Comes through the sourceStays per account
Bid/ask, price, Greeks, implied volatility, underlying prices, option chain and roll searchMargin, net liquidation value, cash, orders, holdings, daily P&L. The daily P&L can stay empty for accounts without their own subscription.

The better state wins per position. The bridge compares the account own price with the price of the source and takes the better one, ranked live, last price only, delayed, no price. On a tie the account keeps its own price. In the Live Cockpit the tooltip of the market data dot then reads "Price via account X". The same rule applies to underlying prices, per underlying: the price of the source replaces the account own price if it is better or the account has none, otherwise the account keeps its own.

Unrealized P&L. If the price of a position comes from the source, the bridge calculates the unrealized profit or loss itself: (price × multiplier − cost basis) × quantity. The price is the midpoint of bid and ask, otherwise the last price. This can differ from the TWS display by a few cents. If the calculated price differs strongly from the price IBKR reports itself (below half or above double), the IBKR value stays. On a tie of the states, bid/ask stay with the account itself; if IBKR has no price for the position, the price for the P&L still comes from the source. Worked examples are in the calculation sheet for the feature.

If the source drops out. If the connection of the source is lost, all accounts fall back to their own prices within one cycle, without an error message. When the source returns, the option applies again. Option chain and roll search run through the source while the option is active and the source is connected; while the option rests or the source is disconnected, they use the first connected account.

New account or different source. The confirmation only covers the accounts the dialog showed when you switched it on. If you connect another account later, the bridge reports it as a hint; the account keeps its own prices until you confirm the option again in the dialog. A change of the source, or a source that reports different account numbers, also needs a new confirmation.

Display on the bridge page. On the Live Bridge settings page a read-only status card shows whether the option is on or off, which source applies, when it was confirmed and for which accounts. The time is shown in server time. If more than one bridge is running, the card shows the state of the bridge that reported last. The state appears only after the bridge is updated to the current version.

Limits. The positions of all accounts share the data lines of the source (by default 100 per login at IBKR). Option chain and roll search take additional lines on the source and compete with the shared positions. The bridge interface is available in German only so far. The self-calculated P&L is a calculation aid, not investment advice.

14. Optionsanalyse im Live-Cockpit (GEX, Flip, Skew)

Der Reiter Optionsanalyse im Live-Cockpit rechnet aus der Optionskette eines Basiswerts Kennzahlen und Diagramme. Er braucht die Bridge, weil die Kette über sie aus deiner TWS kommt. Gib den Basiswert ein oder wähle ihn unter Meine Positionen. Die Rechnung läuft in deinem Browser, deine Kurse bleiben bei dir.

Was die Kennzahlen bedeuten

  • Net GEX (Gamma Exposure): Gamma mal Open Interest mal Kontraktgröße mal Kurs zum Quadrat mal 0,01, je Strike. Calls zählen positiv, Puts negativ. Die Zahl sagt, wie stark sich das Delta der Optionsbücher bei einer Kursbewegung von 1 % ändert.
  • Flip: der Kurs, an dem die aufsummierte GEX-Linie das Vorzeichen wechselt, der dem aktuellen Kurs am nächsten liegt. Gibt es im geladenen Strike-Bereich keinen Vorzeichenwechsel, steht dort „–“.
  • Max Γ: der Strike mit dem größten Betrag an GEX.
  • ATM-IV: implizite Volatilität am Strike nächst am Kurs, je Verfall.
  • P/C Open Interest: offene Puts geteilt durch offene Calls.
  • 25Δ-Skew: IV des Calls mit Delta +0,25 minus IV des Puts mit Delta −0,25, in Volatilitätspunkten.

Was sie nicht bedeuten

  • Das Vorzeichen folgt einer Annahme: Marktteilnehmer, die die Calls verkauft haben, sind kurz Gamma, die Puts-Verkäufer ebenso, und die Gegenseite ist die Börse. Wer tatsächlich auf welcher Seite steht, kennt die Optionskette nicht. Open Interest zeigt offene Kontrakte, nicht Käufer und Verkäufer.
  • Flip und Max Γ sind Konventionen, keine Messwerte und keine Kursziele. Sie sind kein Handelssignal und keine Anlageberatung.
  • Der Open-Interest-Stand wird börsentäglich fortgeschrieben, bei Verfällen am selben Tag ist er veraltet.
  • Die Kennzahlen gelten nur für die geladenen Verfälle und Strikes (Voreinstellung: bis 60 Tage, 20 Strikes um den Kurs). Ein enger Strike-Bereich kann einen Flip verdecken.

Fehlende Werte: Liefert die TWS für einen Kontrakt kein Gamma oder kein Open Interest, geht er nicht in die Summe ein. Wie viele Kontrakte bepreist sind, steht in der Kennzahlenleiste („bepreist x / y“) und in der Spalte „Quelle“ der Tabelle. Fehlende Greeks werden nie geschätzt.

Gewichtung: Nur die Karte „Dealer Exposure“ gewichtet auf Wunsch nach Restlaufzeit (Halbwertszeit 7 Tage). Alle übrigen Zahlen sind ungewichtet, damit die Summen in Kopf, Diagramm und Tabelle übereinstimmen.