Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
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
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Import of historic price data from .csv-file to .bar-file? #432741
11/13/13 16:09
11/13/13 16:09
Joined: Jul 2013
Posts: 3
M
michas Offline OP
Guest
michas  Offline OP
Guest
M

Joined: Jul 2013
Posts: 3
I was wondering if anybody does have the code at hand to read in a .csv file with historic price data and save it as a .bar file?

The records in the csv-file are stored in the format: time, open, high, low, close
(i.e. "31/12/12 00:00, 1.32205, 1.32341, 1.32157, 1.32278")

In the "tips & tricks section" of the manual a small program is given to do the reverse task (i.e. export historic price data from a .bar file to a .csv file).

Thanks a lot!

Re: Import of historic price data from .csv-file to .bar-file? [Re: michas] #432768
11/14/13 15:26
11/14/13 15:26
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
I have no code at hand as I did not need it so far, but the sscanf and strtok functions can be used. There's another example of reading a more complicated .csv file at the end this page:

http://manual.zorro-trader.com/export.htm

Re: Import of historic price data from .csv-file to .bar-file? [Re: michas] #435276
01/05/14 12:52
01/05/14 12:52

A
acidburn
Unregistered
acidburn
Unregistered
A



Originally Posted By: michas
I was wondering if anybody does have the code at hand to read in a .csv file with historic price data and save it as a .bar file?

The records in the csv-file are stored in the format: time, open, high, low, close
(i.e. "31/12/12 00:00, 1.32205, 1.32341, 1.32157, 1.32278")


There is now, michas, find it in this topic: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=435238#Post435238

By adapting sscanf format a bit, you should be able to import virtually any csv format and produce a bar file.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1