2
$\begingroup$

I am trying to download adjusted close prices of different stocks from yahoo finance. I used "Download to Spreadsheet" to download historical prices for each stock and then join these files into one. But it takes a lot of time. I wonder whether there exists a faster way to do it.

Thanks

$\endgroup$
1
  • $\begingroup$ this can be done very easily with custom programming, or with the bulkquotesxl plugin for excel if you don't want to program. $\endgroup$
    – Valtinho
    Commented Mar 16, 2016 at 16:36

2 Answers 2

2
$\begingroup$

Take a look at pandas-datareader.
you will need to use python and write something like this:

# import package and notebook setting
import pandas as pd
import pandas_datareader.data as web
import datetime
pd.set_option('display.max_rows', 999)
pd.set_option('display.max_columns', 999)
pd.set_option('precision', 4)
# load data
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2015, 5, 9)
quotes = web.DataReader(["AAPL", "GOOGL", "TSLA"], 'yahoo', start, end)
$\endgroup$
0
$\begingroup$

Best to download in R studio. use below code to download.

library(quantmod)

tickers = c("^NSEI","ITC.NS", "SBIN.NS", "COALINDIA.NS", "ICICIBANK.NS", "ADANIPORTS.NS", "ONGC.NS", "MOTHERSUMI.NS", "INFY.NS", "TCS.NS", "WIPRO.NS")

getSymbols(tickers, from = "2015-01-01", to = "2016-03-31")

prices.data <- merge(NSEI[,6], ITC.NS[,6], SBIN.NS[,6], COALINDIA.NS[,6], ICICIBANK.NS[,6], ADANIPORTS.NS[,6], ONGC.NS[,6], INFY.NS[,6], TCS.NS[,6], MOTHERSUMI.NS[,6], WIPRO.NS[,6])

head(prices.data)

you can use head(prices.data) to check the downloaded prices.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.