how to get dates #19
-
when downloading historical data, how can you get the date for each value? for example: returns only the gold prices, but can't establish a date for each value |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, @andresrogers can you please try the latest Install it as from investiny import historical_data
from datetime import datetime
data = historical_data(investing_id=8830, from_date="04/27/2000", to_date=datetime.today().strftime("%m/%d/%Y"))
print(data) # Python dictionary that contains the keys: date, open, high, low, close, and volume Hope this helps! I've tested it on my own and it works fine 🤗 P.S. note that you're formatting the current date as |
Beta Was this translation helpful? Give feedback.
-
It works with the latest update, thanks! Do you know if there is a limit of 5000 datapoints? Although I used to_date= "today" it gives me 5000 rows with the latest being 12/02/2019 |
Beta Was this translation helpful? Give feedback.
Hi, @andresrogers can you please try the latest
investiny
release?Install it as
pip install investiny==0.5.0
and then run the following curated version of your code:Hope this helps! I've tested it on my own and it works fine 🤗
P.S. note that you're formatting the current date as
%d/%m/%Y
whileinvestiny
's date should be formatted as%m/%d/%Y
.