Quantcast
Channel: ListenData
Viewing all articles
Browse latest Browse all 425

Excel Macro : Extract historical data for multiple stocks

$
0
0
This tutorial covers excel macro which you can use to download historical data for multiple stock quotes. It is useful when you need to perform detailed technical analysis on stocks you wish to invest. Here source of the data is Yahoo Finance.

In this excel macro, you have flexibility to play around with the following arguments -

  • Period You can select the frequency of historical data for stocks - Daily, Weekly, Monthly. By "daily" it refers to every day's low, high and closing price along with volume. Weekly refers to prices at the start of each week (one entry for one week). Similary monthly corresponds to one record for a month
  • Starting Date Date on which you want historical data starts from
  • End Date Date on which you want historical data ends with.
  • Allows specifying multiple stocks. Data to be appended once data for first stock completes.
Stocks Downloader
Output of stocks downloader look like below.
Reason for data for 15th February is not included because stocks specified in the input are US stocks and Nasdaq stock market was closed on that day on eve of Presidents' Day in US. Data for 22nd February was excluded because End Date argument is not inclusive of the date. If you want data for 22nd February, specify 23rd February in the end date argument.
Stocks Downloader Output
Fetch Historical Data for Non US Stocks
For US Stocks Yahoo Finance does not require any suffix added in symbols or tickers. You can use it directly. However suffix needs to be entered for non US stocks. See some of the examples below.
Canadian StocksIndian Stocks
DOL.TORELIANCE.NS
ENGH.TOTCS.NS
AC.TOHCLTECH.NS
Table below shows a complete list of stock exchanges across world and corresponding suffix used for fetching stock quotes from Yahoo Finance.
CountryMarketSuffix
ArgentinaBuenos Aires Stock Exchange (BYMA).BA
AustriaVienna Stock Exchange.VI
AustraliaAustralian Stock Exchange (ASX).AX
BelgiumEuronext Brussels.BR
BrazilSao Paolo Stock Exchange (BOVESPA).SA
CanadaCanadian Securities Exchange.CN
CanadaNEO Exchange.NE
CanadaToronto Stock Exchange (TSX).TO
CanadaTSX Venture Exchange (TSXV).V
ChileSantiago Stock Exchange.SN
ChinaShanghai Stock Exchange.SS
ChinaShenzhen Stock Exchange.SZ
Czech RepublicPrague Stock Exchange Index.PR
DenmarkNasdaq OMX Copenhagen.CO
EgyptEgyptian Exchange Index (EGID).CA
EstoniaNasdaq OMX Tallinn.TL
EuropeEuronext.NX
FinlandNasdaq OMX Helsinki.HE
FranceEuronext Paris.PA
GermanyBerlin Stock Exchange.BE
GermanyBremen Stock Exchange.BM
GermanyDusseldorf Stock Exchange.DU
GermanyFrankfurt Stock Exchange.F
GermanyHamburg Stock Exchange.HM
GermanyHanover Stock Exchange.HA
GermanyMunich Stock Exchange.MU
GermanyStuttgart Stock Exchange.SG
GermanyDeutsche Boerse XETRA.DE
GreeceAthens Stock Exchange (ATHEX).AT
Hong KongHong Kong Stock Exchange (HKEX)***.HK
HungaryBudapest Stock Exchange.BD
IcelandNasdaq OMX Iceland.IC
IndiaBombay Stock Exchange.BO
IndiaNational Stock Exchange of India.NS
IndonesiaIndonesia Stock Exchange (IDX).JK
IrelandEuronext Dublin.IR
IsraelTel Aviv Stock Exchange.TA
ItalyEuroTLX.TI
ItalyItalian Stock Exchange.MI
JapanTokyo Stock Exchange.T
LatviaNasdaq OMX Riga.RG
LithuaniaNasdaq OMX Vilnius.VS
MalaysiaMalaysian Stock Exchange.KL
MexicoMexico Stock Exchange (BMV).MX
NetherlandsEuronext Amsterdam.AS
New ZealandNew Zealand Stock Exchange (NZX).NZ
NorwayOslo Stock Exchange.OL
PortugalEuronext Lisbon.LS
QatarQatar Stock Exchange.QA
RussiaMoscow Exchange (MOEX).ME
SingaporeSingapore Stock Exchange (SGX).SI
South AfricaJohannesburg Stock Exchange.JO
South KoreaKorea Stock Exchange.KS
South KoreaKOSDAQ.KQ
SpainMadrid SE C.A.T.S..MC
Saudi ArabiaSaudi Stock Exchange (Tadawul).SAU
SwedenNasdaq OMX Stockholm.ST
SwitzerlandSwiss Exchange (SIX).SW
TaiwanTaiwan OTC Exchange.TWO
TaiwanTaiwan Stock Exchange (TWSE).TW
ThailandStock Exchange of Thailand (SET).BK
TurkeyBorsa İstanbul.IS
United KingdomLondon Stock Exchange.L
VenezuelaCaracas Stock Exchange.CR

Viewing all articles
Browse latest Browse all 425

Trending Articles