Hi all,

The original discussion about this can be found here:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=459580#Post459580

The scripts posted here are modified to work with Zorro F as pcz's scripts were written for Zorro S. Some of the limitations imposed on Zorro F break these scripts, so I have attempted to fix them.

Requisites/Checks for running these scripts:

1) Your data must be sourced from TickDownloader (from Strategy Quant). I tried with tickstory data, modifying the line format to match that of TickDownloader but to no avail. Make your life easy and get the data via TickDownloader (it's free anyway)

2) Install vanilla python

3) Install Cygwin and ensure you install the python tool set (if you already have Cygwin installed, rerun the installer and you can modify your current install)

4) Download both convert2.py and ConvertData2.c
- place convert.py whereever you want (keep in mind you will call it from cygwin)
- place ConvertData.c in Zorro/Strategy

5) Open convert2.py and change the following
- line16; set data_path to the location of your tick files
- line17, set zorro_path to the location of your zorro executable

6a) Open ConvertData2.c and change the following (depending on what you want)
- if you want only tick (t1 files) then comment out line9: #define M1
- if you want only M1 (t6 files) then comment out line8: #define TCK
- if you want both be sure to uncomment both lines

6b) Change start and end variables (line16/17) to the years you want to generate files for. Of course, you need the tick data though. ConvertData2 will handle missing data accordingly.

7) Open Cygwin and call convert2.py. There are a number of options which are defined main() of convert2.py and also discussed in the original thread/blog post. The most basic of calls:
Code:
python convert2.py



So what have I done to get this to work with Zorro F....
- Input variables cannot be passed to Zorro F from the command line with the exception of -a (Asset flag). To get around this, ConvertData2 will look for the required files based on int start, int end and -a (passed from and handled by convert2.py)
- Extending the above, print statements will report the year, instrument and type of data it is looking for, if it finds it, and what it's doing about it
- Further extending the above, if a file already exists, it will not be processed, thereby saving a heck of a lot of time. If you want to update partial year files it is best to delete the file and reprocess it from scratch
- The call to ConvertData2 from convert2 has been modified to not pass input variables
- That's pretty much it

There has been another flag added to convert2.py -k
If you want to keep the year-by-year tick files (csv format) to inspect them for peace of mind or whatever then set the -k flag when calling convert2. This should keep the files which you can delete at your leisure.

Files generated from convert2 have the following naming convention:
tick files: t{asset}_{year}
M1 files: {asset}_{year}
Files generated from convertData2 have the following namin convention:
Ask tick files: {asset}_{year}.t1
Bid tick files: !{asset}_{year}.t1
M1 files: {asset}_{year}.t6


While I'm on flags, if you want just t1 or t6 files then don't forget about -p. -p=1 for M1/t6 files and -p=0 for tick/t1 files. The -p flag is separate to #define TCK/M1. It only tells the python script how to split up the data from the tick file. The #define control what files the Zorro script (t1/t6).

Thanks to pcz for doing all the heavy lifting on this and helping me bumble my way through these very minor modifications. There is plenty of info about this on the original thread or over on their blog (url is in the original thread)

Cheers,
BobbyT

EDIT: forgot to mention that LOGFILE has now been included in ConvertData2. Check Zorro/Log if you miss the output in the zorro terminal

Attached Files
conversionScripts.zip (19 downloads)
Last edited by BobbyT; 07/11/17 21:20.