Set Account Code Problem

Continuing the discussion from Using Autotrader with IB with multiple accounts:

Hi I have try to set the place order with Tomasz's method,

		ibc = GetTradingInterface("IB");
		AccountNo = "Uxxxxx12";
        ibc.SetAccount(AccountNo);
        
          bID = ibc.PlaceOrder( ticker, "Buy", entrysize, "MKT", 0, 0, "Day", 
true, TradeTickSize, "outsideRTH" , "", "", "", "", "Uxxxxx12" );

but still got

When I have only one account I dun set any account info, it can auto trade properly.
How to solve the problem?

Many Thanks!

You should pass account in PlaceOrder() call only. There is no need for SetAccount if you are passing PlaceOrder with account.

Also the error message says INVALID account code, which means that the account you gave was invalid.

1 Like

HI there,

I have the exact same problem and the account given is the correct account code and still it says invalid account code. I have two accounts with IB. But I was still able to trade.

Regards,

Jorgen

All those errors are generated by Traders Workstation, NOT AmiBroker.
You should complain to IB and they should explain why you get those errors.

AmiBroker does NOTHING, it just passes what you specify to TWS and displays TWS-generated errors back to you. If TWS produces error code it is TWS thing, not AmiBroker.

Interactive Brokers is the proper address of your questions.

IBController is open source, see: AmiBroker / IBController · GitLab There is no PROCESSING inside. It is just passing things back and fourth.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.