Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 13,353 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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