stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
12.87k stars 4.11k forks source link

Download and store STOOQ data #243

Closed mresquivias closed 2 years ago

mresquivias commented 2 years ago

In the notebook Download and store STOOQ data. I have downloaded manually the files to get the STOOQ data but I’m facing some problems with the code.

Trying to add symbols EmptyDataError: No columns to parse from file (that’s obvious cause I’m reading .csv files and if you download the data manually you got .txt files.

And if a try to store it in the assets.h5 file I got FileNotFoundError: [Errno 2] No such file or directory: 'stooq\\tickers\\jp\\tse stocks.csv' (the folder structure I got is the one of the stooq web page (data/freq/market/asset_class).

Which is the easiest way to solve it?

Thanks in advance,

stefan-jansen commented 2 years ago

I'm afraid you'll have to adapt the code to the layout of the folders you've downloaded. The examples are intended for illustration and should allow you to rewrite them so you can read the files as now provided by Stooq. Unfortunately, free data comes with the cost that one has little control over how it is provided. Hope this helps.