Open ghost opened 2 years ago
Hi,
Not 100% sure about this, but after trying to debug your code and what the get_stock_historical_data()
function in investpy/stocks.py
really does, it seems (line 588) that it tries to check in the file investpy/resources/stocks.csv
if the stock you are looking for (symbol: NIO, href: nio-inc) is in it or not. And after all, a quick search shows that NIO stock is not hard coded in the stocks.csv
file.
One temporary solution may be to clone the repo on your own, insert an appropriate line in stocks.csv
for the NIO stock you are looking for, which in my opinion look like this:
united states,Nio A ADR,Nio Inc Class A ADR,nio-inc,US62914V1061,{insert_index},USD, NIO
The insert_index
should be between the past and the next value, an easy way to do would be to put the line at the end and use the last index + 1.
Then, import the "new" investpy package you just modified. Hope it helped.
The third-to-last column in stocks.csv
is an ID used by investing.com (rather than an arbitrary insertion index), so it must be correct.
I created a script here to extract and format these values.
Since I was already creating a PR to add a stock for my own purposes, I included NIO along with mine: https://github.com/alvarobartt/investpy/pull/525
Hi,
retrieving historical data for certain stocks does not seem to work. For example, I tried:
Same when I tried
I have checked the investing.com site and there I see the historical data. So, the data exist for the stock in this example.