Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

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).

share|improve this question
    
Hi Samo, welcome to quant.SE and thanks for your question. Please consider registering in order to edit and respond to answers and to gain further privileges. –  Tal Fishman Aug 10 '11 at 1:36
    
nasdaq site is extremely dated. bloomberg is up to date. –  DroBuddy Jan 22 at 2:13
add comment

6 Answers

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.

share|improve this answer
add comment

You can download all stocks on the three exchanges listed in your question from the NASDAQ website: http://www.nasdaq.com/screening/company-list.aspx.

It looks like removing those entries with an industry of "N/A" will eliminate ETFs and other funds from the list.

share|improve this answer
add comment

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.

share|improve this answer
    
I have a problem using this function, in fact I only get gibberish. I posted on [R-Sig-Finance] on the matter. –  Owe Jessen Aug 12 '11 at 13:12
1  
@Owe: I answered on R-SIG-Finance. Basically, the file changed and I haven't pushed the update to CRAN yet. The R-Forge version of TTR works. Sorry for the confusion. –  Joshua Ulrich Aug 12 '11 at 13:18
    
No problem, thanks for the fast reply and for writing this function. –  Owe Jessen Aug 12 '11 at 13:27
add comment

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.

share|improve this answer
2  
Very nice! I'll have to add a function to TTR to access these files. –  Joshua Ulrich Sep 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. –  pacoverflow Jun 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 P Jan 26 at 3:14
add comment

easy2data financial section With list of hang seng companies,nasdaq companies,cac 40 companies, S&P asia 50 companies etc...

share|improve this answer
4  
You need to disclose your affiliation, otherwise this is just an ad (and not even a very good one). –  chrisaycock Nov 7 '13 at 19:31
add comment

Slightly ugly bash one-liner for a sorted JSON array:

echo "[\"$(echo -n "$(echo -en "$(curl -s --compressed 'ftp://ftp.nasdaqtrader.com/SymbolDirectory/nasdaqlisted.txt' | tail -n+2 | head -n-1 | perl -pe 's/ //g' | tr '|' ' ' | awk '{printf $1" "} {print $4}')\n$(curl -s --compressed 'ftp://ftp.nasdaqtrader.com/SymbolDirectory/otherlisted.txt' | tail -n+2 | head -n-1 | perl -pe 's/ //g' | tr '|' ' ' | awk '{printf $1" "} {print $7}')" | grep -v 'Y$' | awk '{print $1}' | grep -v '[^a-zA-Z]' | sort)" | perl -pe 's/\n/","/g')\"]"


EDIT: Filtered out test stocks

share|improve this answer
add comment

protected by olaker Jan 22 at 8:30

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 1 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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