Convert Yahoo Australia stock data to .t6 problem

Posted By: jyd

Convert Yahoo Australia stock data to .t6 problem - 10/12/22 02:12

Hi,

Does anyone have experience in converting australia stock csv from Yahoo finance to Zorro .t6 format? I am using the following code, which works but the resulting .t6 file is not loaded by Zorro.

int recordCount = dataParse(1, "%Y-%m-%d,f3,f1,f2,f4,f5,f6", "A2M.AX.csv");
if (recordCount) dataSave(1, "A2M.t6");

The csv can be download from: https://finance.yahoo.com/quote/A2M.AX/history?p=A2M.AX
The first few lines of the csv are as below
Date,Open,High,Low,Close,Adj Close,Volume
2015-03-31,0.555000,0.595000,0.530000,0.565000,0.565000,4816294
2015-04-01,0.575000,0.580000,0.555000,0.565000,0.565000,4376660
2015-04-02,0.560000,0.565000,0.535000,0.555000,0.555000,2779640
2015-04-07,0.545000,0.550000,0.540000,0.545000,0.545000,392179
2015-04-08,0.545000,0.545000,0.530000,0.540000,0.540000,668446
2015-04-09,0.540000,0.540000,0.532000,0.535000,0.535000,706846
2015-04-10,0.530000,0.535000,0.530000,0.535000,0.535000,175104
....

When I open the A2M.t6 file Zorro throw following errors:
History A2M.t6
Warning 035: A2M ticks overlap on 2015-04-01 00:00:00
Warning 035: A2M ticks overlap on 2015-04-02 00:00:00
Warning 035: A2M ticks overlap on 2015-04-07 00:00:00
Warning 035: A2M ticks overlap on 2015-04-08 00:00:00
A2M 1910 ticks read
Error 030: Wrong date range 2015-03-31 00:00:00 - 2015-03-31 00:00:00

However, if I use ZHistoryEditor to open the .t6 file, then I can view the file without any issue. If I re-save the file using ZHistoryEditor, then Zorro can load it correctly. So I guess I need to do some data clearance before converting it to the .t6 format? But I don't know what I need to do to clean the data. Thanks in advance if anyone can show me some hints, tips or instructions on this subject.
Posted By: AndrewAMD

Re: Convert Yahoo Australia stock data to .t6 problem - 10/12/22 13:14

Most likely, the data is in reverse order. Call dataSort(1) after dataParse.

https://zorro-project.com/manual/en/data.htm
Posted By: jyd

Re: Convert Yahoo Australia stock data to .t6 problem - 10/13/22 13:20

Thanks Andrew, you are right. data downloaded from yahoo is in reverse order, after that is corrected, it works. By the way, is there any function we can call to also fix the data outlier problem?
Posted By: AndrewAMD

Re: Convert Yahoo Australia stock data to .t6 problem - 10/14/22 02:20

What outlier problem? Either the market was truly volatile, or you have bad data. I think you can figure out which is the case.
Posted By: jyd

Re: Convert Yahoo Australia stock data to .t6 problem - 10/16/22 23:27

ok, thanks for the tip
© 2024 lite-C Forums