Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Ayumi, AndrewAMD, Quad), 1,014 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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