Gamestudio Links
Zorro Links
Newest Posts
phantom() not defined in indicators.c
by jcl. 08/07/26 11:45
Pause button for evaluation shell?
by jcl. 08/07/26 11:43
Accepting new programming clients
by AndrewAMD. 08/06/26 21:25
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (maslone1, 1 invisible), 1,294 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19222 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Z9 getting Error 058 #489364
04/20/26 15:57
04/20/26 15:57
Joined: Jan 2025
Posts: 4
K
k_ivan Offline OP
Guest
k_ivan  Offline OP
Guest
K

Joined: Jan 2025
Posts: 4
I have Zorro S, after upgrading to Zorro 3.01.6 trying to run Trade on Z9, worked before every time, I am getting the Error 058, see attachment.

Also here is what I have in history.csv:

Uzyskaj apikey:

1. Otwórz stron? https://stooq.pl/q/d/?s=XLV.US&get_apikey
2. Wpisz kod captcha.
3. Skopiuj link pobrania pliku CSV znajduj?cy si? w dole strony - b?dzie zawiera? zmienn? <apikey>.
4. Do swoich zapyta? dopisz zmienn? <apikey> z jej warto?ci?, np.
https://stooq.pl/q/d/l/?s=XLV.US&am...;apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Looks like the apikey used is invalid. Please advice on how to fix.

Thanks

Attached Files 2026-04-20_115211.png
Re: Z9 getting Error 058 [Re: k_ivan] #489367
04/24/26 17:48
04/24/26 17:48
Joined: Jul 2000
Posts: 28,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
Frankfurt

Re: Z9 getting Error 058 [Re: jcl] #489370
04/25/26 19:13
04/25/26 19:13
Joined: Jan 2025
Posts: 4
K
k_ivan Offline OP
Guest
k_ivan  Offline OP
Guest
K

Joined: Jan 2025
Posts: 4
thank you, I might just wait for the stable release

Re: Z9 getting Error 058 [Re: jcl] #489459
06/10/26 14:38
06/10/26 14:38
Joined: Jan 2025
Posts: 4
K
k_ivan Offline OP
Guest
k_ivan  Offline OP
Guest
K

Joined: Jan 2025
Posts: 4
Any update on the issue? This makes Zorro completely unusable.

Thanks

Re: Z9 getting Error 058 [Re: k_ivan] #489477
06/16/26 09:51
06/16/26 09:51
Joined: Jul 2000
Posts: 28,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
Frankfurt
You have to get the historical data from another source, like AlphaVantage or EOD, or from your broker. Stooq is currently not delivering data for direct download, not even with an API key. We have already looked for a free alternative, but found none. If anyone knows a free and daily updated source for D1 data, please let us know.

Re: Z9 getting Error 058 [Re: k_ivan] #489492
06/24/26 13:57
06/24/26 13:57
Joined: Mar 2021
Posts: 5
Palm Beach, United States
F
flip26 Offline
Newbie
flip26  Offline
Newbie
F

Joined: Mar 2021
Posts: 5
Palm Beach, United States
@jcl How can this be done using the Z9 system? I've been using Z9 for quite some time and now need to rebalance but obviously the Stooq mechanism no longer works properly.

Re: Z9 getting Error 058 [Re: k_ivan] #489496
06/26/26 14:07
06/26/26 14:07
Joined: Jul 2000
Posts: 28,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
Frankfurt
Edit the asset list and remove the "!STOOQ:..." part from the symbol. Then load the recent asset histories in D1 format from your broker or another source, and put them in the History folder. Then run Z8 or Z9 as usual.

Re: Z9 getting Error 058 [Re: k_ivan] #489520
07/09/26 18:09
07/09/26 18:09
Joined: Apr 2016
Posts: 49
madpower2000 Offline
Newbie
madpower2000  Offline
Newbie

Joined: Apr 2016
Posts: 49
Hi jcl,

I am trying to run Z9 after updating Zorro S to the latest 3.11.12 version.

Because my IBKR account does not currently have US ETF real-time streaming market data (due geo restriction), I updated the Z9 history files from EODHD instead. This part now seems to work.

I used a small Lite-C script with:

asset(Loop1);
assetHistory(strf("%s.US",Loop1), FROM_EOD|FOR_ASSET);

Now the issue is when I run Z9 in Trade mode.

My current AssetsZ9.csv contains only ETFs such as:

AGG, DIA, FDN, HYG, IGM, ITB, SMH, TLT, VGK, VOO, SPY, SPLV, XBI, XLI, XLU, XLV


But when I start Z9 Trade, the log shows some symbols that are not in my current AssetsZ9.csv, for example AMZN and AOK:
```
Loading 16 assets..
NY time 13:42
!Requested market data requires additional subscription for API. See link in 'Market Data Connections' dialog for more details.AGG ARCA/TOP/ALL AGG-STK--0.00--SMART/--USD
!The contract description specified for AGG is ambiguous;
you must specify the currency. AGG-STK--0.00--SMART/--
!Requested market data requires additional subscription for API. See link in 'Market Data Connections' dialog for more details.AMZN NASDAQ.NMS/TOP/ALL AMZN-STK--0.00--SMART/--USD
!The contract description specified for AMZN is ambiguous;
you must specify the currency. AMZN-STK--0.00--SMART/--
!Requested market data requires additional subscription for API. See link in 'Market Data Connections' dialog for more details.AOK ARCA/TOP/ALL AOK-STK--0.00--SMART/--USD
``
So I have questions:

1. Which asset list does Z9 Trade actually load?
I expected it to use my current History/AssetsZ9.csv, but the log suggests that another asset list or cached list is being used.

2. Is there a generated/cache file that I should delete after replacing AssetsZ9.csv or after updating history files?
For example, does Z9 use another internal list, optimized list, .fac/.par/.c/.trd file, or something generated by Z8/Z9?


I understand that the “Requested market data requires additional subscription for API” message is probably expected. But I was previously sucesfuly Trade with Z9 without live quote subscription. My main confusion is why Z9 Trade loads symbols that are not in my current AssetsZ9.csv, and whether there is a proper cleanup/rebuild step after updating the asset list and history.

Thanks.

Last edited by madpower2000; 07/09/26 18:10.
Re: Z9 getting Error 058 [Re: k_ivan] #489523
07/13/26 12:46
07/13/26 12:46
Joined: Jul 2000
Posts: 28,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
Frankfurt
Yes, it used the Z8 asset list. We have changed it, so it's now using the correct Z9 list. If you want a specific list, you can give it in a z9.ini file. There is no cache for assets.

Re: Z9 getting Error 058 [Re: jcl] #489527
07/14/26 19:40
07/14/26 19:40
Joined: Apr 2016
Posts: 49
madpower2000 Offline
Newbie
madpower2000  Offline
Newbie

Joined: Apr 2016
Posts: 49
Thanks a lot, JCL! Really appreciate the quick follow-up fix.

I downloaded the latest Zorro version and installed it over my existing installation.

Then I:

- updated the historical data for all assets in `AssetsZ9.csv`
- started TWS
- ran Z9 in Trade mode

Z9 now appears to load the correct list:

NY time 15:22
Loading 17 assets..

However, startup is very slow, and the run stops with the following output:

--------------------------------------------------

NY time 15:22
Loading 17 assets..
!Requested market data requires additional subscription for API. See link in 'Market Data Connections' dialog for more details.AGG ARCA/TOP/ALL AGG-STK--0.00--SMART/--USD
!The contract description specified for AGG is ambiguous;
you must specify the currency. AGG-STK--0.00--SMART/--
!Requested market data requires additional subscription for API. See link in 'Market Data Connections' dialog for more details.DIA ARCA/TOP/ALL DIA-STK--0.00--SMART/--USD
!The contract description specified for DIA is ambiguous;
you must specify the currency. DIA-STK--0.00--SMART/--
!Requested market data requires additional subscription for API. See link in 'Market Data Connections' dialog for more details.FDN ARCA/TOP/ALL FDN-STK--0.00--SMART/--USD
Error 047: No bars generated
Logout..
!Logout complete ok

--------------------------------------------------

Last edited by madpower2000; 07/14/26 19:42.
Re: Z9 getting Error 058 [Re: k_ivan] #489530
07/15/26 10:20
07/15/26 10:20
Joined: Jul 2000
Posts: 28,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
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 Offline
Newbie
madpower2000  Offline
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,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
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 Offline
Newbie
madpower2000  Offline
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
07/21/26 17:48
07/21/26 17:48
Joined: Apr 2016
Posts: 49
madpower2000 Offline
Newbie
madpower2000  Offline
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
07/22/26 06:42
07/22/26 06:42
Joined: Jul 2000
Posts: 28,131
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,131
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
07/22/26 10:56
07/22/26 10:56
Joined: Apr 2016
Posts: 49
madpower2000 Offline
Newbie
madpower2000  Offline
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; 07/22/26 11:05.
Re: Z9 getting Error 058 [Re: jcl] #489560
07/22/26 14:01
07/22/26 14:01
Joined: Apr 2016
Posts: 49
madpower2000 Offline
Newbie
madpower2000  Offline
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 1 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