Trading multiple personal accounts on IB with IBC


I have been trading with IBC/Amibroker on my individual IB trading account for years and it has been working flawlessly.

I have now opened an IRA Margin account and would like to look at trading a modified version of my system (long only) on that account as well.

I see in the IBController 1.38 docs that ‘SetAccount’ will set the current active account, or I can reference the account in the PlaceOrder call - but it also says this feature is for Financial Advisor accounts. I only want to trade on my own personal accounts. Does SetAccount work in this use case as well? Any other gotchas I should look out for?



Looks like I should have left well enough alone! My IRA account was approved over the weekend so when Amibroker/IB started running this morning it got totally confused about which account to use.

I added some ‘SetAccount’ and ‘SetInfoAccount’ calls and that mostly seemed to work, but the PositionLists etc. were not reliably being retrieved…

Is it okay to call SetAccount fairly often to switch between accounts?



It takes time for TWS to deliver data if you switch account. It is not instant. It is better to use “ALL” account for information retrieval (SetInfoAccount) and send orders to TWS passing account as ARGUMENT of PlaceOrder call.
It is LAST argument in the list (from
PlaceOrder( string Ticker, string Action, number Quantity, string Type, number LimitPrice, number StopPrice, string TimeInForce, bool Transmit, [optional] number TickSize = 100, [optional] string Attributes = “”, [optional] string ParentID = “”, [optional] string OCAGroup, [optional] number OCAType, [optional] string FAParams, [optional] string Account)


Thanks, Tomasz.

I set up my account, for now, to only look at my main trading account (by doing a SetAccount and SetInfoAccount to that account). But when I did that, my PlaceOrders were still failing (presumably because it somehow didn’t know which account to use, etc. even though I had done a SetAccount to the right account) - but I have now changed by PlaceOrder calls to explicitly pass it the account per your suggestion above.

Once I fund my IRA account I’ll look at changing it again to use the “ALL” account and make other adjustments accordingly.