Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 177 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problems with importing daily EOD data from csv to history #466881
07/05/17 18:06
07/05/17 18:06
Joined: Jul 2017
Posts: 7
M
mltradefx Offline OP
Newbie
mltradefx  Offline OP
Newbie
M

Joined: Jul 2017
Posts: 7
Hi, I have been fighting the following problem now for days and am desperate:

I would like to use my own data downloaded from different sites and stored as CSV files. Unfortunately I am lost trying to figure out how to store them in a way to use them in Zorro.

I have been trying to figure out what I am doing wrong when using the CSVtoHistory.c script to import EOD and Daily Open High Low Close-Prices.

I made sure to adjust the string format of the script to my csv file (in the case of Close, Open, High, Low):

string Format = "%d.%m.%Y,f4,f3,f1,f2";

and ran the script CSVtoHistory.c. I then went on using the newly created data in Zorro. It seemed my t6 data files were off. When checking for possible errors by converting the t6 file back to csv using the CSVfromHistory.c script, for some reason in the csv-file every second and third line is messed up, while every third line seems correct, but missing lines inbetween, e.g:

1899/12/30 10:19:12,0.00000,1.71500,1.76200,7.15462
2017/06/14 00:00:00,1.78100,1.78300,1.67300,1.71700
1899/12/30 14:52:48,1.79500,0.00000,7.15459,1.77300
1899/12/30 13:32:10,0.00000,1.76600,1.77500,7.15457
2017/06/09 00:00:00,1.73500,1.79100,1.72700,1.76600
1899/12/30 11:31:12,1.78000,0.00000,7.15451,1.74200
1899/12/30 09:12:58,0.00000,1.73800,1.71200,7.15450
2017/06/05 00:00:00,1.72000,1.74700,1.71400,1.74300
1899/12/30 10:33:36,1.72000,0.00000,7.15445,1.71400
1899/12/30 12:40:19,0.00000,1.76200,1.76300,7.15442
2017/05/31 00:00:00,1.76800,1.78000,1.74700,1.75300

I simply don't know where to go from here, I tried opening and correcting my csv files in every editor I know and have available in case my formatting is off. I unfortunately also don't see any errors in the CSVtoHistory.c or CSVfromHistory.c scripts. When parsing the data via dataParse from the csv file and outputting dataVar() via printf the data seems to be correct. But once stored as t6 and reading it from there, the data is completely messed up and not usable.

I appreciate all your help in giving me hints where to go from here. Thanks.

Re: Problems with importing daily EOD data from csv to history [Re: mltradefx] #466892
07/06/17 08:51
07/06/17 08:51
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Either your date code or the number of fields in the Format string is apparently wrong, so check and make sure to match the format of the EOD CSV you're importing.

You need not convert the file back: On the download page is a tool named "ZHistoryEditor" that allows you to look in .t6 files. So you can quickly check if your Format string is right or not.

Re: Problems with importing daily EOD data from csv to history [Re: jcl] #466900
07/06/17 12:00
07/06/17 12:00
Joined: Jul 2017
Posts: 7
M
mltradefx Offline OP
Newbie
mltradefx  Offline OP
Newbie
M

Joined: Jul 2017
Posts: 7
It worked! thanks so much. In retrospect I didn't realize what order and what the right amount of columns was, in which I have to arrange my data in the csv file in. It became obvious once I used the tool you mentioned "ZHistoryEditor". I arranged my data in the exact same way it is outlined in the tool in my csv file and also adjusted the format in the script accordingly, to reflect the same order and same amount of columns. And it worked. Much appreciated, thank you!

Re: Problems with importing daily EOD data from csv to history [Re: jcl] #466924
07/08/17 13:46
07/08/17 13:46
Joined: Jul 2017
Posts: 7
M
mltradefx Offline OP
Newbie
mltradefx  Offline OP
Newbie
M

Joined: Jul 2017
Posts: 7
Hi jcl, thanks again for your help. But there seem to be more problems with this than was apparent at first. For some reason the data is still messed up in a very irregular way. Below is a copy/paste of the zHistoryEditor showing a selection of lines from my t6-file. Out of this selection I market all lines yellow that show an incorrect opening price, which instead is the same as the closing price. For the same lines also the Low Price is wrong being the same as the High. The pattern and number of yellow marked, i.e. incorrect, lines seems completely random to say that it is somehow only weekends or other specific days that are messed up. I am completely stuck. I don't know where else to look for a mistake. It just doesn't look like a logical mistake. The csv-file is correct. I double and triple-checked it for the same lines that are messed up in t6 (Decimal separator is a comma here, since I am from Germany, values separated by space):

Time Open High Low Close Vol Spread


2010.01.04 00:00 0,121847078 0,121847078 0,122145414 0,122145414 0 0
2010.01.05 00:00 0,122145414 0,122145414 0,123722121 0,123722121 0 0
2010.01.06 00:00 0,123722121 0,123722121 0,12501125 0,12501125 0 0
2010.01.07 00:00 0,12501125 0,12501125 0,126735985 0,126735985 0 0
2010.01.08 00:00 0,126735985 0,126735985 0,127231076 0,127231076 0 0
2010.01.11 00:00 0,126694039 0,127231076 0,127231076 0,126694039 0 0
2010.01.12 00:00 0,125529274 0,126694039 0,126694039 0,125529274 0 0
2010.01.13 00:00 0,124676749 0,125529274 0,125529274 0,124676749 0 0
2010.01.14 00:00 0,124676749 0,124676749 0,124754429 0,124754429 0 0
2010.01.15 00:00 0,124754429 0,124754429 0,125364587 0,125364587 0 0
2010.01.18 00:00 0,124110736 0,125364587 0,125364587 0,124110736 0 0
2010.01.19 00:00 0,122703828 0,124110736 0,124110736 0,122703828 0 0
2010.01.20 00:00 0,120488331 0,122703828 0,122703828 0,120488331 0 0
2010.01.21 00:00 0,118012756 0,120488331 0,120488331 0,118012756 0 0
2010.01.22 00:00 0,118012756 0,118012756 0,118633315 0,118633315 0 0
2010.01.25 00:00 0,118633315 0,118633315 0,119293787 0,119293787 0 0
2010.01.26 00:00 0,119293787 0,119293787 0,119983405 0,119983405 0 0
2010.01.27 00:00 0,119983405 0,119983405 0,121241517 0,121241517 0 0
2010.01.28 00:00 0,119147956 0,121241517 0,121241517 0,119147956 0 0
2010.01.29 00:00 0,119147956 0,119147956 0,120793946 0,120793946 0 0
2010.02.01 00:00 0,12006779 0,120793946 0,120793946 0,12006779 0 0
2010.02.02 00:00 0,12006779 0,12006779 0,12152449 0,12152449 0 0
2010.02.03 00:00 0,120967992 0,12152449 0,12152449 0,120967992 0 0
2010.02.04 00:00 0,12056575 0,120967992 0,120967992 0,12056575 0 0
2010.02.05 00:00 0,119980909 0,12056575 0,12056575 0,119980909 0 0
2010.02.08 00:00 0,118730642 0,119980909 0,119980909 0,118730642 0 0

Re: Problems with importing daily EOD data from csv to history [Re: mltradefx] #466925
07/08/17 19:51
07/08/17 19:51
Joined: Jul 2017
Posts: 7
M
mltradefx Offline OP
Newbie
mltradefx  Offline OP
Newbie
M

Joined: Jul 2017
Posts: 7
I found the pattern of the yellow lines. Whenever the closing price of the following day is lower than the current day, the opening price happens to be the same as the closing price. Why does the dataparse or datasave function do this overwrite of the originally correct prices? It certainly isn't like this in the csv-file. Please help, thank you.

Re: Problems with importing daily EOD data from csv to history [Re: mltradefx] #466927
07/08/17 21:09
07/08/17 21:09
Joined: Jul 2017
Posts: 7
M
mltradefx Offline OP
Newbie
mltradefx  Offline OP
Newbie
M

Joined: Jul 2017
Posts: 7
Ok, I found the mistake, I switched Low and Open in the csv-file, this did the trick. Due to the Low being also the Open for these lines made this very confusing.


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