Well the script that I typed in here was wrong. I apologize. The second asset command should have read as follows:
asset("USDCHF_Broker2");
and the result is however that I always get the Balance of the broker in the zorro scroll window and not the Balance on the account of Broker2. That is why I claim that changing to an asset, which involves a change in the broker, does not change the account parameters to that broker of the current asset.

Support has suggested me to use the function accountBroker instead. However this does not work either for me. I still get the same result.

The use of the accountBroker function also raises a number of questions:

1. The manual says that the function accountBroker calls the function AccountBroker (with capital first letter). There is however a discrepancy
in the number of parameters of the functions accountBroker and the API function AccountBroker. There is an additional string subaccount in the accountBroker function, the meaning of which is not explained. It says this subaccount parameter is optional. Not using it however yields an error. I suspect that this subaccount parameter is related to the account entry in the Accounts.csv, a parameter that is also not used at present and is therefore put to zero in the Accounts.csv (but please note the use of different terms: account versus subaccount. That is confusing). What does this mean now? Should the subaccount string in the accountBroker function call be set equal to "0" or ""? Trying either way, yields the same wrong result, namely I always get the account parameters of the broker selected in the scroll down window.

2. I would also like to point out that the accountBroker function is not present in the zorro functions overview list:
https://zorro-project.com/manual/en/funclist.htm

3. BrokerAccount differs also from brokerAccount because the first function returns a value that allows to check whether there is a connection to the broker. Unfortunately brokerAccount does not return a value (at least it is not described in the manual). So one can not perform the check.

4. Is it possible to use BrokerAccount (instead of brokerAccount) from within a zorro script? I have the same question for all the other useful API functions like BrokerSell, BrokerStop, .... I get an undeclared identifier error, so presumably I would have to use some #include <...>? I guess I don't understand why the Broker API functions are not accessible from within the zorro trade engine script and instead one has to use assetBroker, accountBroker, commandBroker rather than AssetBroker, AccountBroker, .... There are many more of these API functions than there are equivalent functions one can use in a zorro script. It would be nice to be able to use all of the API functions.
















Last edited by hatten; 12/22/18 18:07.