Import of historic price data from .csv-file to .bar-file?

Posted By: michas

Import of historic price data from .csv-file to .bar-file? - 11/13/13 16:09

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!
Posted By: jcl

Re: Import of historic price data from .csv-file to .bar-file? - 11/14/13 15:26

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
Posted By: Anonymous

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

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.
© 2024 lite-C Forums