Rate my current method of storing and accessing historical data
Currently I have a function that takes the arguments: (ticker, start_date, end_date), and looks to see if I have a .csv file of that ticker's data on my pc. Right now I'm only dealing with OHLC but I do plan on incorporating other types of data like fundamental or other.
Function:
If I don't have a .csv file of that ticker in the folder where my data is stored:
Pull that ticker's data in the desired date range from the api and save a .csv
If I do have a .csv:
Read in the file and check to see if the desired date range exists
If the date range doesn't exist:
Pull that ticker's data in the desired date range from the api and save a .csv
I don't know anything about database platforms or languages. What are the specific benefits of using something like SQL as opposed to what I'm doing? I'm trying to get an idea of at what point it would be worth it for me to learn something like this.
Posted Jan 22, 2020, 12:30 AM UTC · edited
To speed things up you could save your data as an unformatted binary file with suffix .bin (for example) and read from that during future runs. I do this.
This is a new concept to me. Is it as simple as using a function from whatever language you're using to just read in the binary file? What does the data look like when you read it in?
The specifics are programming language dependent, but I think every language has the feature. Two terms used are "pickling" and "serialization".