Kaushik Choudhury
1 min readAug 30, 2020

--

Hello, Bradly

The code discussed in the article will download the stock data of each company in a separate excel file.

def stockdata(ticker):    start= dt.datetime(2000,1,1)    ## Start Date Range
end=dt.datetime.now() ## Curret date as end date Range
Stock=web.DataReader(ticker, "yahoo", start, end)

name=str(ticker) + ".xlsx"
Stock.to_excel(name)
return ()
""" Filename - stockdownload.py"""
import GetStockData
ticker= ["MU", "ASML","TSM","QCOM", "UMC", "^SOX", "INTC","^IXIC"]
for i in ticker:
GetStockData.stockdata(i)

You need to then consolidate the Adjusted closing price column from each spreadsheet into a common sheet as shown in the screenshot.

Hope it helps. If you need more information or guidance then please do let me know.

--

--

Kaushik Choudhury
Kaushik Choudhury

Written by Kaushik Choudhury

Kaushik Choudhury is an experienced Supply Chain Strategy and Digital Transformation manager in one of the Big 4 Consulting firm in the UK.

No responses yet