Is there a way to automatically download historical prices of stocks from yahoo finance or google finance (csv format)? Preferably in Python.
It's trivial when you know how:
import yfinance as yf df = yf.download('CVS', '2015-01-01') df.to_csv('cvs-health-corp.csv')
If you wish to plot it:
import finplot as fplt fplt.candlestick_ochl(df[['Open','Close','High','Low']]) fplt.show()