Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Active Threads | Active Posts | Unanswered Today | Since Yesterday | This Week
Zorro Scripts
Yesterday at 10:45
Hello everybody,


I am having trouble to convert a CSV file to a .t1 file. When I print the parsed values, none of the columns is being correctly parsed and I don't receive any warning or error message.

The CSV file has following format:

Code
Time,AskPrice,BidPrice
1704213005783,49.20,49.10
1704213006179,49.22,49.13
1704213006575,49.23,49.13
1704213007576,49.24,49.13


I use following lines to parse the file:

Code
string Format = "+%t,f,f";

int Year;
for(Year = 2024; Year <= 2024; Year++) {
	dataNew(1,0,0);
	int records = dataParse(1,Format,strf(CSVFileName,Year), 0, 0);
	printf("\n%i - %d rows read",Year,records);

	dataNew(2,0,0);
	int i, N = 0;

	for(i = 0; i < records; i++) 
	{
		var time = dataVar(1,i,0);
		var askPrice = dataVar(1,i,1);
		var bidPrice = dataVar(1,i,2);
		printf("%s: %.2f, %.2f\n", strdate("%Y.%m.%d %H:%M:%S.", time), bidPrice, askPrice);
		
		T1* Quote = dataAppendRow(2,2);
		Quote->time = time;
		Quote->fVal = -bidPrice;
		Quote = dataAppendRow(2,2);
		Quote->time = time;
		Quote->fVal = askPrice;
		N += 2;
	}

	dataSave(2,strf(OutName,Year), 0, N); // store year dataset
	printf("\n%s saved",strf(OutName,Year));
}



Can somebody help me to find the problem?

I attached a sample CSV file and the complete code.


Best regards,

EC
0 32 Read More
Zorro Future
Yesterday at 10:11
Quote
StartWeek/ EndWeek
Start and end of the business week in dhhmm local time in the BarZone, where d = day number (1 = Monday .. 7 = Sunday) hh = hour and mm = minute. Default: Start 72300 (Sunday 23:00), end 52000 (Friday 20:00). Used to determine the weekend for BarMode flags.
EndWeek does work as it should: setting it to 51631 or 51646 will generate friday bars appropriately, to the minute.

But with StartWeek=71800-71815, the first bar of the week will end Sun,1800
with StartWeek=71820-71915, the week will start from Sun, 1900.



0 27 Read More
Bug Hunt
04/17/24 23:47
My response is still the same.
3 25 Read More

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