Peter Molnár Thank you for your reply. Yahoo Finance only provides the data per stock or index, could not find a way to download the full set of data for the exchange market during the study time frame. For example if we need to calculate R2, returns skewness and zero return , we are going to have to download stock by stock..
Yes, but various statistical software has packages that can download data automatically for you. In other words, downloading stock by stock does not matter, if some package to it for you, and you just specify which stocks you need.
Actually I need them for both, in order to measure the stock returns deviation from the index . Now I know indices historical returns are available on Yahoo Finance, but when you want to get them for a representative sample of the firms, it get pretty complicated..
Someone had hinted at this in an earlier post, but there are many ways to download data for multiple companies from Yahoo Finance.
For example, you can use the R package called "quantmod" and use its "getSymbols" function to specify a list of ticker symbols (stocks and indexes) and download data from Yahoo finance. Then use the "tseries" package and its "monthlyReturn" function to calculate monthly returns. If you are unfamiliar with R, it is a free programming language and packages like the ones I have mentioned above are also made available for free by participants in that ecosystem.
You are welcome! The attached document has an exercise I give my students which asks them to download data using R and run a small portfolio optimization routine. You can find some details regarding the use of "quantmod" and "tseries" packages in there.
We frequently use the getSymbols() command in the quantmod package R to download the stock data in class. This is an example of what Peter Molnár suggests.
Akram Shavkatovich Hasanov thanks for your reply. Quantmod is good when you want to get price data for a bunch of stocks. But for all stocks in the markets, you would need to gather the whole list of the stocks codes as registered in Yahoo Finance, and do that for all the stock markets of the study (11 stocks markets in my case). Not very easy to obtain.