There are several ways to go around getting daily stock prices for free. For example, these are some of the possibilities.
- Yahoo Finance
- Alpha Vantage
- Quandl (free access is limited to the data significantly lagged in time)
Code 'GetSP500_Quandl.py' performs the following:
- Scrap S&P500 constituents from Wikipedia
- Obtain closing daily stock prices from Quandl, using pandas_datareader. One needs to modify some details, for example, the path to the folder to store the results.