Error in Convert.c

Posted By: MattY

Error in Convert.c - 06/12/16 09:48

Hi,

I am trying to convert some of my own data to Zorro. I am using Zorro 1.44.1 on a Win10 64-bit machine.

I started to test the conversion with the "Convert.c" script. Therefore I downloaded the "DAT_ASCII_EURUSD_M1_2015.csv" from histdata.com. This is the format:

20150101 130000;1.209650;1.209770;1.209620;1.209620;0
20150101 130100;1.209630;1.209680;1.209620;1.209620;0

When I click on "test" I always get this error:

Zorro 1.44.1 Trading Automaton
Made with Gamestudio by oP group 2015


Convert compiling..........
Error in 'line 31:
syntax error
< DATE ConvertTime(int Year,int Month,int Day,int Hour,int Minute,int Second)
>.

I have not changed anything in the convert scipt. I also tried with other formats and adapted code in the readTick function. But always the same error. Even when I delete or rename the .csv file in the history folder the error remains. Is this a bug?

Please advise.

Thanks, Matt
Posted By: panz

Re: Error in Convert.c - 06/22/16 16:58

I found the bug in "Convert.c": "Day" is a reserved name in Zorro, but "Convert.c" used it as the input parameter of ConvertTime() and as a general variable name in various other places. To solve this problem, just change all the variables named "Day" to a different name that is not a reserved name, e.g. "aDay".

I have attached the modified "Convert.c" that compiles fine.

Attached File
Convert.c  (6 downloads)
Posted By: MattY

Re: Error in Convert.c - 06/25/16 15:05

Hi panz, thank you very much for your help.

The reserved "Day" had a different color in the editor. But I couldn't figure it out. Now it's working fine.

All the best
Matt
© 2024 lite-C Forums