0
$\begingroup$

I was wondering if there is an efficient way to extract data on all the stocks from the CRSP dataset?

In the Query Form I only have the option to enter company codes individually or to upload a .txt file with one company code per line. Both of which is not an efficient option. Is there a way to possibly achieve this goal in R or Python?

$\endgroup$

1 Answer 1

2
$\begingroup$

You can easily download information about all available stocks from the query form. Simply choose the option Search the entire database (see below).

Furthermore, you should include the exchange code as query variable. NYSE has exchange code 1, AMEX exchange code 2 and NASDAQ exchange code 3. You can delete all other observations or simply implement a conditional statement in the WRDS query form.

enter image description here

$\endgroup$
3
  • $\begingroup$ Wow, much easier than what I thought, thanks. I included the Exchange Code variable, I am not sure what you mean by, "You can delete all other observations or simply implement a conditional statement in the WRDS query form" $\endgroup$
    – yungmist
    Commented Jul 22, 2020 at 21:34
  • 1
    $\begingroup$ @yungmist Well, there are assets that are traded at different exchanges. If you search the entire database, you obtain data for all assets. You should thus throw out all data you don't want. In empirical asset pricing, you typically only include stocks with shrcd (share codde) 10 and 11 (common equity) and exchcd (exchange code) 1, 2 and 3 (NYSE, AMEX, NASDAQ). $\endgroup$
    – Kevin
    Commented Jul 22, 2020 at 21:46
  • 2
    $\begingroup$ See this post for further explanation of shrcd and you will see why you most likely want to exclude some, eg. do you really want to include 'closed end funds'? Or oil well participation certificates ? Probably not. quant.stackexchange.com/questions/39963/… $\endgroup$
    – nbbo2
    Commented Jul 22, 2020 at 21:57

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.