Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (1 invisible), 13,752 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
dabolong, MaliceTheMaker, Haitao_Ren, JimSimons, julienp
19249 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to select between IB accounts by script? #489466
06/12/26 23:17
06/12/26 23:17
Joined: Jan 2021
Posts: 8
Austin, TX, USA
J
Jack_Zodiac Offline OP
Newbie
Jack_Zodiac  Offline OP
Newbie
J

Joined: Jan 2021
Posts: 8
Austin, TX, USA
Hi,

I am trying to either a) switch between IB accounts programmatically, or b) make a fixed selection of account in the script by e.g. a #define literal.

Currently I have set up an Accounts.csv with distinct names, account ids, and renamed copies of the IB DLL. And then I try:

#define SELECTED_ACCOUNT "IB-ACCT2"
#define ACCOUNT_ID "U1234567"

DLLFUNC void main()
{
Account = SELECTED_ACCOUNT; // with or without this
var *pBalance, *pTradeVal, *pMarginVal;
brokerAccount (SELECTED_ACCOUNT, ACCOUNT_ID, pBalance, pTradeVal, pMarginVal);
printf("Selected account %s, id %s\n", SELECTED_ACCOUNT, ACCOUNT_ID);
...
}

The above executes, but the value shown in the Zorro window corresponds to the default account instead of the selected account, and I get some warning/error messages depending on exactly what variation I'm trying ("BrokerAccount: No Data!" or from IB, "!Unable to subscribe to account as the following clients are subscribed to a different account....")

Declaring a string variable = SELECTED_ACCOUNT and passing in the variable name doesn't work either.

How should this be done? Using Zorro S, by the way.

Thanks very much for any insights!

Re: How to select between IB accounts by script? [Re: Jack_Zodiac] #489470
06/13/26 15:44
06/13/26 15:44
Joined: Feb 2017
Posts: 1,838
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,838
Chicago
If I remember correctly, you can use a Family Advisor account to trade with multiple accounts from one endpoint.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1