I have a very basic data question: how to get a list of all common stocks traded on NYSE, NASDAQ and AMEX? I would need to be able to get the approximate list of common stocks as is available in Telechart... I can not get this data at eoddata, for example...

I would like to calculate market breadth indicators and would like to find out how many of common stocks traded were up or down 4% (breakouts/breakdowns) (Cl-Lag(Cl) > 0.04 (4% breakout), Cl-Lag(Cl) < -0.04 (4% breakdown)), how many of common stocks traded are down/up 25% in quarter etc.

My first problem is how to get a list of symbols with only common stocks (no ETFs).

6 Answers
6

NASDAQ makes this information available via FTP and they update it every night. Log into ftp.nasdaqtrader.com anonymously. Look in the directory SymbolDirectory. You'll notice two files: nasdaqlisted.txt and otherlisted.txt. These two files will give you the entire list of tradeable symbols, where they are listed, their name/description, and an indicator as to whether they are an ETF.

Given this list, which you can pull each night, you can then query Yahoo to obtain the necessary data to calculate your statistics.

UPDATE: More information about these files and their fields can be found here.

Very nice! I'll have to add a function to TTR to access these files.
–
Joshua UlrichSep 8 '11 at 18:30

Does Yahoo allow you to run a script to do thousands of HTML fetches against their servers? I know some web sites will ban your IP if you try that.
–
pacoverflowJun 15 '13 at 7:42

@pacoverflow They do, at the very least, allow ~7500 sequential individual requests. It is also possible to download data for up to 200 symbols from Yahoo! in one request.
–
Eliezer PJan 26 '14 at 3:14

Bloomberg Open Symbology has this list. Look in the Common Stock precanned file. This will have a bit more data than you probably need as it has a separate entry and unique id for each place an equity is traded. However it is probably the highest quality list available for free anywhere.

As for filtering ETFs are broken out in a separate file (Equity_ETP) so you simply need to filter by exchange.

This is great because it has all securities globally - I'd found it difficult to get non-US symbols before this.
–
fantabolousJul 7 '14 at 5:21

@fantabolous Can you provide an example for how to use this to get all tickers? Can't figure out how to use it.
–
momoSep 23 '14 at 14:01

@Hamidam E.g. if you want all HK common stock, from the left panel of the link above choose Market Sector: Equity, Sec Type: Common Stock, Country: Hong Kong. Click Submit. Then click "Excel" in top right corner. Done.
–
fantabolousSep 24 '14 at 6:30

Also, for equities if you select a country (not exchange) and then deselect All Exchanges it'll give you only the primary exchange.
–
fantabolousSep 24 '14 at 7:23

The stockSymbols function in the R package TTR pulls the data from nasdaq.com that @bellamyj mentioned. It also attempts to convert the symbols to a format acceptable to Yahoo Finance.

That said, I'm not certain how to filter this list for only common stocks. There are 1275 securities with "n/a" Sector or Industry, leaving ~5000. Perhaps the remaining categories in Sectors and Industries can help you further refine the list.