Where And How To Get The Equity Historical Data (at Least Covers 2008)?
I can use the following code to get historical data from Google Finance. But the oldest is from 2016-09-20. This is too short for back testing. I need historical data which covers
Solution 1:
Use fix-yahoo-finance
and then use yahoo
rather than Google as your source. It looks like Google has been locking down a lot of its data lately.
First you'll need to pip-install fix-yahoo-finance
.
Then:
from pandas_datareader import data
import fix_yahoo_finance
aapl = data.get_data_yahoo('AAPL', start='2000-01-01')
print(aapl.head())
Open High Low Close Adj Close Volume
Date
2000-01-03 3.74554 4.01786 3.63170 3.99777 3.59662 133949200
2000-01-04 3.86607 3.95089 3.61384 3.66071 3.29338 128094400
2000-01-05 3.70536 3.94866 3.67857 3.71429 3.34158 194580400
2000-01-06 3.79018 3.82143 3.39286 3.39286 3.05240 191993200
2000-01-07 3.44643 3.60714 3.41071 3.55357 3.19699 115183600
Post a Comment for "Where And How To Get The Equity Historical Data (at Least Covers 2008)?"