Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
6 registered members (AndrewAMD, madpower2000, Quad, VoroneTZ, TipmyPip, 1 invisible), 1,674 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Z9 getting Error 058 [Re: k_ivan] #489530
07/15/26 10:20
07/15/26 10:20
Joined: Jul 2000
Posts: 28,126
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,126
Frankfurt
You normally don't start Z8 or Z9 in Trade mode. Only when you want to connect to a broker that does not support portfolio rebalancing. In that case you must adapt the asset list to the symbols of your broker, and must subscribe market data for all assets. Otherwise you'll get 'ambiguous' or 'invalid symbol' errors.

If your broker supports rebalancing: First download the latest historical data from AssetsZ9, then run a backtest. It wil generate the rebalance CSV file. In your broker's platform, open the portfolio rebalance window and import that CSV file.

Re: Z9 getting Error 058 [Re: jcl] #489532
07/15/26 12:45
07/15/26 12:45
Joined: Apr 2016
Posts: 49
madpower2000 Online
Newbie
madpower2000  Online
Newbie

Joined: Apr 2016
Posts: 49
Yes, but this workflow worked correctly in previous Zorro versions.

As I understand it, Z9 first downloaded the required historical data from Stooq. After that, when I pressed the `Trade` button in the Zorro GUI, Z9 connected to TWS/IBKR and rebalanced my portfolio directly.

I used this workflow successfully for several years without a US equity market-data subscription.

The reason I cannot simply subscribe now is that IBKR does not offer this live data feed for my account because of my passport/residency jurisdiction.

So my question is: has the intended Z9 workflow changed in recent versions, or was the previous Trade-mode behavior relying on delayed or locally downloaded prices in a way that is no longer supported?

Re: Z9 getting Error 058 [Re: k_ivan] #489533
07/15/26 15:07
07/15/26 15:07
Joined: Jul 2000
Posts: 28,126
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,126
Frankfurt
Yes, the free historical data does no longer exist. To get the old workflow, you need to subscribe data from a vendor, and enter that source in the symbol in your z9 asset list.

Last edited by jcl; 07/15/26 15:11.
Re: Z9 getting Error 058 [Re: jcl] #489547
07/17/26 19:03
07/17/26 19:03
Joined: Apr 2016
Posts: 49
madpower2000 Online
Newbie
madpower2000  Online
Newbie

Joined: Apr 2016
Posts: 49
Thanks, that explains the change.

For my setup, IBKR should remain the execution broker, while EODHD should provide both the current price and historical data.

Is this the correct Symbol syntax for AssetsZ9.csv?

*-STK-SMART-USD!EOD:*.US!EOD:*.US

For example:

AGG-STK-SMART-USD!EOD:AGG.US!EOD:AGG.US

Or does the EODHD source require a different prefix?

My goal is to preserve the previous Z9 Trade workflow: Z9 calculates and executes the rebalance through TWS/IBKR, but does not request US equity market data from IBKR.

Re: Z9 getting Error 058 [Re: jcl] #489555
Yesterday at 17:48
Yesterday at 17:48
Joined: Apr 2016
Posts: 49
madpower2000 Online
Newbie
madpower2000  Online
Newbie

Joined: Apr 2016
Posts: 49
I think I have now isolated the remaining issue.

I ran a minimal GET_POSITION diagnostic with IB diagnostics level 4.

The IB plugin clearly receives my actual open positions from TWS:

!U4934740 XBI-STK--0.00--ARCA/-XBI-USD
!U4934740 XLI-STK--0.00--ARCA/-XLI-USD
!U4934740 VOO-STK--0.00--ARCA/-VOO-USD
!U4934740 VGK-STK--0.00--ARCA/-VGK-USD
!U4934740 IGM-STK--0.00--ARCA/-IGM-USD
!U4934740 SMH-STK--0.00--NASDAQ/-NMS-USD

These are indeed my current positions in TWS.

However, GET_POSITION returns zero for all of them:

XBI Position=0 Avg=0.00
XLI Position=0 Avg=0.00
VOO Position=0 Avg=0.00
VGK Position=0 Avg=0.00
IGM Position=0 Avg=0.00
SMH Position=0 Avg=0.00

I also tested XBI separately with several symbol variants:

XBI
XBI-STK-SMART-USD
XBI-STK-SMART/ARCA-USD
XBI-STK-ARCA-USD

All returned 0.

TWS confirms XBI has:
Exchange: SMART
Primary Exchange: ARCA
Currency: USD

So it appears that TWS position callbacks reach the IB plugin correctly, but GET_POSITION does not match/return them.

This also explains why Z9's rebalance dialog shows all current positions as:

old 0

even though those positions exist in the IB account.

Could this be an IB plugin GET_POSITION issue in the current 3.11 build?


I am using latest Zorro S build with TWS.

Re: Z9 getting Error 058 [Re: k_ivan] #489558
8 hours ago
8 hours ago
Joined: Jul 2000
Posts: 28,126
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,126
Frankfurt
I cannot confirm a problem with GET_POSITION. Please run this script with your paper account:

void main()
{
LookBack = 0;
Verbose = 3;
asset("EUR/USD");
enterLong();
var Pos = brokerCommand(GET_POSITION,Asset);
printf("\nPos: %.0f",Pos);
}

Let me know what it prints.

Re: Z9 getting Error 058 [Re: k_ivan] #489559
4 hours ago
4 hours ago
Joined: Apr 2016
Posts: 49
madpower2000 Online
Newbie
madpower2000  Online
Newbie

Joined: Apr 2016
Posts: 49
```
jcl_test compiling............
Login 0 IB..
!Account DUQxxxxx
!Open IB Socket 4.03
!Account DUQxxxxxat UTC 07-22 11:04 ok

[EUR/USD::L00005] Long 1@1.14045 at 11:04:00
Com 1.00 Mrg 621 Net 0
Broker position: 1
Logout..
!Logout complete ok
```

Last edited by madpower2000; 4 hours ago.
Re: Z9 getting Error 058 [Re: jcl] #489560
1 hour ago
1 hour ago
Joined: Apr 2016
Posts: 49
madpower2000 Online
Newbie
madpower2000  Online
Newbie

Joined: Apr 2016
Posts: 49
I found the problem. Sorry for the false alarm — GET_POSITION is working correctly.

The issue was a typo in my real IB account ID in the Zorro account configuration.

Configured in Zorro:
U493470

Actual IB account:
U4934740

So TWS was correctly sending the positions, which is why I could see lines such as:

!U4934740 XBI-STK--0.00--ARCA/-XBI-USD

but Zorro was filtering them against the incorrectly configured account ID. This resulted in GET_POSITION returning 0 and GET_TRADES returning 0.

After correcting the account ID, the same diagnostic now gives:

GET_ACCOUNT = <U4934740>
GET_POSITION = 165
GET_AVGENTRY = 128.1209
GET_TRADES = 6

So there is no GET_POSITION / IB plugin problem.

Apologies for the confusion and for sending everyone down the wrong path. The diagnostics did exactly what they were supposed to do and eventually exposed my configuration mistake.

Thanks jcl for suggesting the paper-account test — that was what led me to isolate the real cause.

Page 2 of 2 1 2

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