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 typeSTK(covering U.S. stocks and ETFs), routing destinationSMART, empty derivative fields, and the target weight percentage to two decimal places (0.01%). - Implicit cash treatment: ENSEMBLE includes any positive
CASHweight when running largest-remainder basis-point rounding across the entire 100.00% book, and then omits theCASHrow 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
csvorjson(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:
DES,TLT,STK,SMART,,,,,,43.41 DES,SPY,STK,SMART,,,,,,39.72 DES,GLD,STK,SMART,,,,,,16.87Inspect 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:
- 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). - Confirm ticker mappings and exchange routing.
STK+SMARThandles 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. - 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.
- Archive the run ID alongside your trade blotter. Keep the ENSEMBLE
model_id,run_id, andas_ofdate 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.
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.
Related
- For advisorsTurn a reviewed allocation into a broker-format file.
Inspect the model and allocation date, choose a supported Business format, and carry the weights into your own review and execution workflow.
- For advisorsAltruist model portfolio CSV export guide.
Export dated target or drifted allocations from ENSEMBLE in Altruist's custom-model CSV format with exact 100.00% rounding and pre-upload verification checks.
- For advisorsComposed multi-sleeve model portfolios (models of models).
Combine independent child sleeves into parent advisor portfolios in ENSEMBLE with full look-through ETF weights, dependency freshness tracking, and unified exports.
- AI agentsAutomate model refreshes with the API and webhooks.
Combine scheduled ENSEMBLE refreshes, Business HMAC-signed webhooks, and REST allocation exports to automate model review and reporting pipelines.