--- title: "StreamXLS — How it works" description: "How StreamXLS works — one DLL, one COM registration, native Excel =RTD() formulas. Hardened for production use." canonical: https://streamxls.com/how-it-works updated: 2026-08-16 source: markdown mirror of the HTML page at the canonical URL, generated at build time by gen-md.py — do not edit order_staging: "StreamXLS cannot send or trigger live orders. Staged orders do not transmit to the market unless a user clicks in TWS to submit." --- # How it works — What StreamXLS is. > **Orders — what StreamXLS cannot do:** StreamXLS cannot send or trigger live orders. Staged orders do not transmit to the market unless a user clicks in TWS to submit. One DLL, one COM registration, [one demo workbook](https://streamxls.com/StreamXLS.xlsm) illustrating every feature so you can start without reading documentation. No Excel ribbon, no add-in; StreamXLS doesn’t run until you ask for it via Excel-native [`=RTD()` formulas](https://streamxls.com/docs-reference). The engine runs on your machine against your own TWS API installation. ## What it looks like — On the sheet Screenshots of StreamXLS in action. Click any image to enlarge it. [![An Excel sheet listing account fields down column A — buying power, net liquidation, excess liquidity — with a column of values for each of five account numbers.](https://streamxls.com/assets/shot-accounts-v1.webp)](https://streamxls.com/assets/shot-accounts-v1.webp) *Multiple accounts in one worksheet.* [![An Excel sheet with a row per open position — AMD, INTC, MSFT, SPY, NVDA and others — showing size, average cost, market value and profit and loss.](https://streamxls.com/assets/shot-positions-v1.webp)](https://streamxls.com/assets/shot-positions-v1.webp) *Positions with live P&L.* [![An Excel sheet with a row per order, each showing its status, symbol, side, order type, quantity, quantity filled and limit price.](https://streamxls.com/assets/shot-orders-v1.webp)](https://streamxls.com/assets/shot-orders-v1.webp) *Order monitoring (read-only).* [![An Excel sheet laid out as an option chain, with the strike price down the center, call quotes to its left and put quotes to its right.](https://streamxls.com/assets/shot-options-v1.webp)](https://streamxls.com/assets/shot-options-v1.webp) *Option chain with streaming quotes and greeks.* ## What makes it production-grade — Fail loud When the trader looks at a cell, they have to be able to trust it. A blank cell is honest — it says the system doesn’t know. A cell that shows data that has quietly gone stale is a trade error waiting to happen. So the engine is built to fail loud: a contract repeated throughout the code is that *stale data is worse than no data*. On a dropped connection, realtime prices are designed to read `#N/A` rather than holding a last good value — so that a stale price surfaces as a visible gap rather than a silently frozen number. Holding to that design principle — across broken connections and the undocumented quirks on both sides of the bridge — is the part of production engineering that real money makes non-negotiable. [That principle, and the war stories behind it, are the subject of the writing →](https://streamxls.com/beyond-market-data) ## The gap it closes — From sample to production-grade Interactive Brokers ships a sample Excel RTD server with the TWS API. Per IBKR’s [documentation](https://www.interactivebrokers.com/campus/ibkr-api-page/excel-rtd/#limitations), it is “not intended to be used as production level trading tools.” It is a teaching artifact that streams top-of-book quotes, with callbacks for account values, positions, and orders left as empty stubs. Closing the gap means implementing the API to subscribe and receive all market-data fields, account values, positions, and orders; supporting multiple accounts; implementing COM-compliant multithreading so the stream survives even when Excel’s UI is busy or blocked; hardening against TWS exceptions — detecting silent disconnects and rate limits, reconnecting and resubscribing automatically; late-seeding and deduplicating between RTD topics and TWS subscriptions; and letting multiple Excel instances run RTD streams against the same TWS. That’s the work StreamXLS does — at first for my own desk, now for anyone with the same needs. [The full case for why a spreadsheet is the right host is its own essay. Read it →](https://streamxls.com/why-excel) ## The product — Technical features ### Automatic reconnection When TWS restarts or the link drops mid-session, StreamXLS reconnects and re-issues the subscriptions that were active. While the link is down, realtime price fields are designed to return `#N/A` rather than show a stale value. `"status", "IsConnected" → 1 (connected)` ### Keeps working when Excel is busy Excel pauses RTD updates while a modal dialog is open or a cell is in edit mode. StreamXLS keeps processing the TWS feed on its own threads and delivers the buffered data once Excel is ready to receive it. `data caches · keeps receiving` ### Subscription deduplication Multiple `=RTD()` calls referencing the same API topic are deduplicated by StreamXLS, minimizing the demand on TWS. `N copies → 1 TWS subscription` ### Order staging from Excel A `StageOrder` topic populates a TWS order ticket. It’s the one topic that acts *outbound* — every other formula only reads TWS. (Staged orders do not transmit to the market until a trader clicks `Submit` in TWS.) `RTD("Tws.Rtd", , "StageOrder", …)` ### Beyond market data Stream not only market data, but also account values (136 fields, per-currency), positions, P&L, and orders — every API field provided through Excel `=RTD()` formulas. `market · accounts · positions · orders` ### Standard Excel RTD Native Excel `=RTD()` formulas just work — no add-in, nothing new to learn. Excel only loads StreamXLS when you request it. The engine streams data with your own TWS API installation. `RTD ProgID: "Tws.Rtd"` See every formula in the [Reference →](https://streamxls.com/docs-reference) · [the demo workbook](https://streamxls.com/StreamXLS.xlsm) · [the documentation](https://streamxls.com/docs) --- *StreamXLS is not affiliated with, endorsed by, or sponsored by Interactive Brokers. Trader Workstation, the TWS API, and Excel are products of their respective owners; their use is governed by their respective licenses. StreamXLS does not provide investment advice or recommendations.* *Markdown mirror of , generated at build time. Every public page on this site is also served as markdown at the same path plus `.md`. Index: .*