Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
What's up with dataParse Handle? #486646
09/13/22 14:55
09/13/22 14:55
Joined: Apr 2022
Posts: 21
H
HamzaAhmed Offline OP
Newbie
HamzaAhmed  Offline OP
Newbie
H

Joined: Apr 2022
Posts: 21
Using Zorro Version 2.50.2 on 64 bit Windows 11 Pro.

While enumerating through 4652 historical data csv files and attempting to convert them to T6 format using dataParse in the following manner

Code
int Records = dataParse(count,Format,InName);
printf("\n%d lines read from %s",Records,InName);


I observed that if the value of the Handle (count) exceeds 1500 dataParse does not read csv records.

Code
dataParse (int Handle, string Format, string Filename, int Start, int Num): int 


Therefore I could just convert first 1500 of my 4652 files. As soon as count became 1501 dataParse failed as verified in the Log file

Code
1497      -> GTEIT_eod.csv
2680 lines read
E:\Zorro_2502\CSV\BSE\GTEIT_eod.t6
1498      -> GTLINFRA_eod.csv
3904 lines read
E:\Zorro_2502\CSV\BSE\GTLINFRA_eod.t6
1499      -> GTL_eod.csv
4557 lines read
E:\Zorro_2502\CSV\BSE\GTL_eod.t6
1500      -> GTNINDS_eod.csv
4250 lines read
E:\Zorro_2502\CSV\BSE\GTNINDS_eod.t6
1501      -> GTNTEX_eod.csv
0 lines read
E:\Zorro_2502\CSV\BSE\GTNTEX_eod.t6
1502      -> GTPL_eod.csv
0 lines read
E:\Zorro_2502\CSV\BSE\GTPL_eod.t6
1503      -> GTV_eod.csv
0 lines read


Currently I have side stepped this hitherto undiscovered and serious Zorro bug grin [attempting to lay my hands on a Zorro S(uper) license] by resetting count to 1 when it exceeds 1500.

Code
// reset count back to 1 since dataparse does not parse data with handle greater than 1500
// nice chance to grab Zorro S so I can use multiple cores and find my buried love for C++
if (count == 1501){
    count = 1;
}


Proof is in the Logs
Code
1497      -> GTEIT_eod.csv
2680 lines read from E:\Zorro_2502\CSV\BSE\GTEIT_eod.csv
E:\Zorro_2502\CSV\BSE\GTEIT_eod.t6
1498      -> GTLINFRA_eod.csv
3904 lines read from E:\Zorro_2502\CSV\BSE\GTLINFRA_eod.csv
E:\Zorro_2502\CSV\BSE\GTLINFRA_eod.t6
1499      -> GTL_eod.csv
4557 lines read from E:\Zorro_2502\CSV\BSE\GTL_eod.csv
E:\Zorro_2502\CSV\BSE\GTL_eod.t6
1      -> GTNINDS_eod.csv
4250 lines read from E:\Zorro_2502\CSV\BSE\GTNINDS_eod.csv
E:\Zorro_2502\CSV\BSE\GTNINDS_eod.t6
2      -> GTNTEX_eod.csv
3615 lines read from E:\Zorro_2502\CSV\BSE\GTNTEX_eod.csv
E:\Zorro_2502\CSV\BSE\GTNTEX_eod.t6
3      -> GTPL_eod.csv
1275 lines read from E:\Zorro_2502\CSV\BSE\GTPL_eod.csv
E:\Zorro_2502\CSV\BSE\GTPL_eod.t6
4      -> GTV_eod.csv
999 lines read from E:\Zorro_2502\CSV\BSE\GTV_eod.csv
E:\Zorro_2502\CSV\BSE\GTV_eod.t6
5      -> GUFICBIO_eod.csv
4597 lines read from E:\Zorro_2502\CSV\BSE\GUFICBIO_eod.csv
E:\Zorro_2502\CSV\BSE\GUFICBIO_eod.t6


I have successfully converted all my 4652 history csv files to T6 format correctly but seriously what's up with dataParse Handle?

Re: What's up with dataParse Handle? [Re: HamzaAhmed] #486647
09/13/22 15:00
09/13/22 15:00
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
https://zorro-project.com/manual/en/data.htm

You should definitely observe the 1000 limit. Your code can otherwise crash.

Re: What's up with dataParse Handle? [Re: HamzaAhmed] #486648
09/13/22 15:01
09/13/22 15:01
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
From the manual:
Quote
Handle: A number from 1...1000 that identifies the dataset. Handles above 1000 are interally used for Zorro's pre-defined indicators.

https://zorro-project.com/manual/en/data.htm

Re: What's up with dataParse Handle? [Re: jcl] #486649
09/13/22 15:04
09/13/22 15:04
Joined: Apr 2022
Posts: 21
H
HamzaAhmed Offline OP
Newbie
HamzaAhmed  Offline OP
Newbie
H

Joined: Apr 2022
Posts: 21
code and Zorro did not crash. Happily works with 1500 handle.

I guess I have to get a huge caffeine shot before reading the manual. Eyes Wide Shut Open.

Re: What's up with dataParse Handle? [Re: AndrewAMD] #486650
09/13/22 15:05
09/13/22 15:05
Joined: Apr 2022
Posts: 21
H
HamzaAhmed Offline OP
Newbie
HamzaAhmed  Offline OP
Newbie
H

Joined: Apr 2022
Posts: 21
Hmm....1000; but till 1500 my code works fine.

Re: What's up with dataParse Handle? [Re: HamzaAhmed] #486651
09/13/22 15:34
09/13/22 15:34
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted by HamzaAhmed
Hmm....1000; but till 1500 my code works fine.

This will break once you use Zorro's pre-defined indicators, as the manual states. If you play with fire, you get burned. grin

Re: What's up with dataParse Handle? [Re: AndrewAMD] #486653
09/13/22 16:28
09/13/22 16:28
Joined: Apr 2022
Posts: 21
H
HamzaAhmed Offline OP
Newbie
HamzaAhmed  Offline OP
Newbie
H

Joined: Apr 2022
Posts: 21
Then I might as well extinguish it with 1000. Updated code ... in a hurry.

Re: What's up with dataParse Handle? [Re: HamzaAhmed] #486658
09/14/22 10:47
09/14/22 10:47
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
Just wonder why do you need more than 1 handle? At least if you're doing the conversion in a single thread

Re: What's up with dataParse Handle? [Re: alun] #486673
09/16/22 14:06
09/16/22 14:06
Joined: Apr 2022
Posts: 21
H
HamzaAhmed Offline OP
Newbie
HamzaAhmed  Offline OP
Newbie
H

Joined: Apr 2022
Posts: 21
Using the same handle will keep writing to the first file IMHO. Zorro stalwarts can shed more light.

Re: What's up with dataParse Handle? [Re: HamzaAhmed] #486674
09/16/22 14:19
09/16/22 14:19
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted by HamzaAhmed
Using the same handle will keep writing to the first file IMHO. Zorro stalwarts can shed more light.

That's wrong. Handles are for in-memory allocations only. You can re-use the same handle many times to write completely different files.

To reset a dataSet, use dataNew:
https://zorro-project.com/manual/en/data.htm

Page 1 of 2 1 2

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