Skip to content
For advisors

Interactive Brokers (IBKR) rebalance CSV export guide.

Export reviewed model target allocations from ENSEMBLE in Interactive Brokers TWS rebalance CSV format, with implicit cash handling and pre-import verification.

By Updated 2 min read

Interactive Brokers (IBKR) advisors, family offices, and active systematic investors rely on Trader Workstation's Rebalance Portfolio tool to translate target model weights into staged orders across single accounts or advisor model groups. Formatting TWS contract rows manually invites typos, broken routing fields, and rounding drift.

On ENSEMBLE's Business plan ($99/month), every saved model and retained run exports directly to an IBKR rebalance CSV (<model>-<date>-ibkr-rebalance.csv) through the web workspace, REST API, CLI, or MCP.

Exact IBKR TWS CSV structure produced by ENSEMBLE

ENSEMBLE serializes each positive security holding as a standard headerless TWS contract description row:

DES,SPY,STK,SMART,,,,,,39.72
DES,TLT,STK,SMART,,,,,,43.41
DES,GLD,STK,SMART,,,,,,16.87

Key rules built into ENSEMBLE's IBKR serializer:

  • Contract fields: Each row begins with DES (contract description), followed by the ticker symbol, security type STK (covering U.S. stocks and ETFs), routing destination SMART, empty derivative fields, and the target weight percentage to two decimal places (0.01%).
  • Implicit cash treatment: ENSEMBLE includes any positive CASH weight when running largest-remainder basis-point rounding across the entire 100.00% book, and then omits the CASH row from the IBKR CSV so the remaining percentage stays implicitly in cash. For example, an 80% SPY / 20% CASH target exports one row (DES,SPY,STK,SMART,,,,,,80.00).
  • Strict long-only check: Short positions or gross exposures above 100% are rejected explicitly rather than silently rescaled. If your model runs long-short or >100% ticker weights, export generic csv or json (available on every plan) and apply your firm's own execution tooling.
  • Resolved look-through weights: Composed multi-sleeve models export flat underlying ticker weights after resolving every child sleeve.

Live format preview from a saved ENSEMBLE model

Below is the exact IBKR rebalance CSV generated by ENSEMBLE's production serializer from the saved Risk Parity Research Example baseline target:

IBKR format preview · Target dated 2026-10-30 · Business
DES,TLT,STK,SMART,,,,,,43.41
DES,SPY,STK,SMART,,,,,,39.72
DES,GLD,STK,SMART,,,,,,16.87
Inspect the saved allocation →

Pulling the file via API or CLI

Retrieve the latest target decision (book=target) or simulated drifted book (book=current) directly from your terminal or automation pipeline after a webhook refresh notification:

# REST API: export the latest target weights in IBKR TWS format (Business)
curl "https://api.ensemble.markets/v1/models/MODEL_ID/exports?format=ibkr&book=target" \
  -H "Authorization: Bearer $ENSEMBLE_API_KEY"

# CLI: fetch the IBKR CSV for a specific retained run
ensemble models export MODEL_ID --format ibkr --run-id RUN_ID

Operational checks inside IBKR TWS before transmitting

ENSEMBLE never connects to Interactive Brokers or places live trades. Treat every imported CSV as an input to your own brokerage review checklist:

  1. Verify legacy positions slated for exit. Holdings present in your IBKR account that do not appear in the new CSV must be reviewed explicitly in TWS (set their target to 0% inside Rebalance Portfolio if you intend to close them).
  2. Confirm ticker mappings and exchange routing. STK + SMART handles standard U.S.-listed stocks and ETFs; verify that any recently renamed ticker or non-standard listing resolves to the intended IBKR contract ID before staging orders.
  3. Check order type, lot size, and liquidity. Review bid-ask spreads and select appropriate limit or adaptive algo order parameters inside TWS rather than blind market orders on thinly traded ETFs.
  4. Archive the run ID alongside your trade blotter. Keep the ENSEMBLE model_id, run_id, and as_of date attached to your internal execution record for clean auditability.

Start preparing an IBKR export with your agent

Use the workflow below to inspect a saved model's latest target weights, verify its data date, and generate an IBKR rebalance CSV for your review.

Start with this request

Use ENSEMBLE to confirm my connected account. Help me select a model and inspect its latest successful allocation and data date. Check my plan's export capabilities, explain the available broker formats, and prepare the format I choose for my review. Do not place trades.

Frequently asked questions

What row format does ENSEMBLE produce for Interactive Brokers TWS?
ENSEMBLE outputs headerless IBKR TWS rebalance contract rows in the format DES,<SYMBOL>,STK,SMART,,,,,,<WEIGHT>, where WEIGHT is a percentage to two decimal places (0.01%).
Why is there no CASH row in ENSEMBLE's IBKR rebalance CSV?
In Interactive Brokers TWS rebalance files, unallocated portfolio weight remains in cash implicitly. ENSEMBLE includes cash when rounding all positive weights to 100.00% total, then omits the CASH line from the IBKR file so security percentages reflect the exact intended allocation.
If a security I already hold in IBKR is missing from the exported CSV, will IBKR automatically liquidate it?
No. Absent tickers in an allocation file are not automatic liquidation instructions in TWS. Always review existing positions, target percentages, and generated closing orders inside IBKR's Rebalance Portfolio tool before transmitting any orders.
Can ENSEMBLE export short or leveraged portfolios to the IBKR CSV template?
No. Broker templates on Business require a fully allocated, long-only book (including cash) summing to 100%, and reject short or leveraged books instead of silently normalizing exposure. Use generic CSV or JSON export when working with short or leveraged weights.

Backtests are illustrative. Past performance does not guarantee future results. ENSEMBLE is a software platform, not an investment adviser.

Part of Keep model portfolios ready for the next review..

Build, document, and export advisor model portfolios in ENSEMBLE.Connect to agents