Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Error with multi-broker scripts #475511
12/17/18 18:38
12/17/18 18:38
Joined: Jul 2016
Posts: 51
H
hatten Offline OP
Junior Member
hatten  Offline OP
Junior Member
H

Joined: Jul 2016
Posts: 51
The following issues are encountered when using assets from multiple brokers (recent release 1.96.4 zorro S):

1. When terminating the trade script, the user is asked whether the open trades should be closed or not. Only trades from one broker are closed, presumably the one associated with the last asset command. For the other trades, a "can't close" error message is received.

2. If one resumes trading and you have chosen the option not to close the open trades upon interrupting the trade script, only trades from one broker will be resumed. For the trades of the other broker one receives a "not found" error.

This appears to be a bug as it is not related to any specific broker. The important consequence of this bug is that it is not possible to resume trading after interrupting the script. Very annoying.

It is obvious from the trade log in MTR4 that for the trades that were not closed, zorro does not switch to the proper broker, since there are additional entries in the trade log of the first broker for the unsuccesful close orders of the second broker. These close orders are however nonsense as it states closed at price 0.0000.

Re: Error with multi-broker scripts [Re: hatten] #475516
12/18/18 08:35
12/18/18 08:35
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
We can confirm this problem. It will be fixed in one of the next updates. Until then, when terminating a broker arbitrage session with open trades, close the trades manually.

Re: Error with multi-broker scripts [Re: jcl] #475552
12/20/18 19:44
12/20/18 19:44
Joined: Jul 2016
Posts: 51
H
hatten Offline OP
Junior Member
hatten  Offline OP
Junior Member
H

Joined: Jul 2016
Posts: 51
The following issue when using multiple brokers has been raised before:
#include <profile.c>

function run()
{
BarZone = WET;
BarPeriod = 1;
LookBack = 0;

asset("USDCHF_Broker1");
printf("n BALANCE %f",Balance);
asset("USDCHF_Broker1");
printf("n BALANCE %f",Balance);
}

The Balance that is printed is in both cases the one of the broker account selected in the zorro window. When inserting a trade command, trades are opened with broker1 and broker2, so I am sure that the Accounts.csv as well as the asset file are correct.

I received the feedback that this issue has been solved, but I can not confirm this. My results contradict this.

Last edited by hatten; 12/20/18 20:00.
Re: Error with multi-broker scripts [Re: hatten] #475557
12/21/18 10:23
12/21/18 10:23
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
What exactly is the problem with your script? Aside from printing the same balance twice, it should work as coded.

Re: Error with multi-broker scripts [Re: jcl] #475568
12/22/18 17:45
12/22/18 17:45
Joined: Jul 2016
Posts: 51
H
hatten Offline OP
Junior Member
hatten  Offline OP
Junior Member
H

Joined: Jul 2016
Posts: 51
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.

Moderated by  Petra 

Gamestudio download | chip programmers | 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