CUSIP Numbers

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

CUSIP Numbers

Anshul Pandey
Hi All,

I am moving some of my backtesting logics to CUSIP from tickers.
How do I download the CUSIP number of US stocks?

I know S&P has a paid subscription, but I read that CUSIP is publicly
available at a few resources.

Any suggestions are highly welcome.

Thanks
Anshul

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: CUSIP Numbers

hova9411
Hi Anshul,

CUSIP's are owned by S&P so they aren't really public. Anyhow, you wont
want to use those to backtest as they are driven by the underlying
company's name (imagine what happens to a CUSIP when there is any M&A
activity). MSCI Barra & S&P's Compustat's Point-In-Time ID's are built for
this type of backtesting. If you have access to BBID's that would be a
decent alternative but looking for an open source identifier system is
going to be tough. Good luck sir.

~James

On Wed, Jan 21, 2015 at 7:45 AM, Anshul Pandey <[hidden email]>
wrote:

> Hi All,
>
> I am moving some of my backtesting logics to CUSIP from tickers.
> How do I download the CUSIP number of US stocks?
>
> I know S&P has a paid subscription, but I read that CUSIP is publicly
> available at a few resources.
>
> Any suggestions are highly welcome.
>
> Thanks
> Anshul
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: CUSIP Numbers

Alec Schmidt-2
Fidelity customers can find CUSIPs (one at a time):
  http://activequote.fidelity.com/mmnet/SymLookup.phtml

On 01/21/2015 1:03 PM, James Ho wrote:

> Hi Anshul,
>
> CUSIP's are owned by S&P so they aren't really public. Anyhow, you wont
> want to use those to backtest as they are driven by the underlying
> company's name (imagine what happens to a CUSIP when there is any M&A
> activity). MSCI Barra & S&P's Compustat's Point-In-Time ID's are built
> for
> this type of backtesting. If you have access to BBID's that would be a
> decent alternative but looking for an open source identifier system is
> going to be tough. Good luck sir.
>
> ~James
>
> On Wed, Jan 21, 2015 at 7:45 AM, Anshul Pandey <[hidden email]>
> wrote:
>
>> Hi All,
>>
>> I am moving some of my backtesting logics to CUSIP from tickers.
>> How do I download the CUSIP number of US stocks?
>>
>> I know S&P has a paid subscription, but I read that CUSIP is publicly
>> available at a few resources.
>>
>> Any suggestions are highly welcome.
>>
>> Thanks
>> Anshul
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R
>> questions
>> should go.
>>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R
> questions should go.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: CUSIP Numbers

Daniel Cegiełka
In reply to this post by Anshul Pandey
2015-01-21 16:45 GMT+01:00 Anshul Pandey <[hidden email]>:
> Hi All,
>
> I am moving some of my backtesting logics to CUSIP from tickers.
> How do I download the CUSIP number of US stocks?
>
> I know S&P has a paid subscription, but I read that CUSIP is publicly
> available at a few resources.
>
> Any suggestions are highly welcome.

You may be interested in Bloomberg Open Symbology, as an alternative to CUSIP.

http://bsym.bloomberg.com/sym/

Best regards,
Daniel

>
> Thanks
> Anshul
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: CUSIP Numbers

gsee
Since this is an R mailing list, I'll try to bring this thread back on
topic.  Unless you are willing to pay, the only free source that I am
aware of to get CUSIPs via R is TradeKing.
https://developers.tradeking.com/documentation/market-ext-quotes-get-post

You must have an account, but you can create an account for free and
you don't have to fund it in order to do this.


library(ROAuth) #importFrom(ROAuth, OAuthFactory)
library(RJSONIO) #importFrom(RJSONIO, fromJSON)

#' ## This part could go in your .Rprofile
#' # Set your application keys # https://developers.tradeking.com/applications
#' cKey <- '################'
#' cSecret <- '#################'
#' oKey <- '################'
#' oSecret <- '################'

# Set the API endpoint
tkURL <- "https://api.tradeking.com/v1/market/ext/quotes.json"

# Create the OAuth connection - this is straight from the ROAuth
documentation on CRAN
credentials <- OAuthFactory$new(consumerKey=cKey,
                                consumerSecret=cSecret,
                                oauthKey = oKey,
                                oauthSecret = oSecret,
                                needsVerifier=FALSE,
                                signMethod='HMAC')
# Update the connection so the handshake is TRUE
credentials$handshakeComplete <- TRUE

Symbols <- tolower(c("AAPL", "MSFT")) ## Whatever symbols you want
symbols <- paste(Symbols, collapse=",")

#what <- "datetime,bidsz,bid,ask,asksz,last,chg,pchg,opn,hi,lo,vl"
what <- "cusip"
what <- gsub(" ", "", tolower(paste(unlist(strsplit(what, ",")),
                                      collapse=",")))
tkURL <- "https://api.tradeking.com/v1/market/ext/quotes.json"
query <- list(symbols=symbols, fids=what)
response <- credentials$OAuthRequest(tkURL, query)
res <- fromJSON(response)
qt <- res$response$quotes$quote
qt

#[[1]]
#     cusip       exch     symbol
#"59491810"     "NASD"     "MSFT"
#
#[[2]]
#     cusip       exch     symbol
#"03783310"     "NASD"     "AAPL"

HTH,
Garrett

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: CUSIP Numbers

Anshul Pandey
Thank you all for the reply.
This is very helpful.

I am going through the Bloomberg Open Symbology. Looks like CUSIP and SEDOL
are becoming popular (the last 3 hedge funds I talked to mentioned one of
these two), so it would be nice to see what Bloomberg has to offer.

James, you raised a very valid concern. I will keep that in mind while
setting up my production system.

Best Regards
Anshul

On Thu, Jan 22, 2015 at 3:55 AM, G See <[hidden email]> wrote:

> Since this is an R mailing list, I'll try to bring this thread back on
> topic.  Unless you are willing to pay, the only free source that I am
> aware of to get CUSIPs via R is TradeKing.
> https://developers.tradeking.com/documentation/market-ext-quotes-get-post
>
> You must have an account, but you can create an account for free and
> you don't have to fund it in order to do this.
>
>
> library(ROAuth) #importFrom(ROAuth, OAuthFactory)
> library(RJSONIO) #importFrom(RJSONIO, fromJSON)
>
> #' ## This part could go in your .Rprofile
> #' # Set your application keys #
> https://developers.tradeking.com/applications
> #' cKey <- '################'
> #' cSecret <- '#################'
> #' oKey <- '################'
> #' oSecret <- '################'
>
> # Set the API endpoint
> tkURL <- "https://api.tradeking.com/v1/market/ext/quotes.json"
>
> # Create the OAuth connection - this is straight from the ROAuth
> documentation on CRAN
> credentials <- OAuthFactory$new(consumerKey=cKey,
>                                 consumerSecret=cSecret,
>                                 oauthKey = oKey,
>                                 oauthSecret = oSecret,
>                                 needsVerifier=FALSE,
>                                 signMethod='HMAC')
> # Update the connection so the handshake is TRUE
> credentials$handshakeComplete <- TRUE
>
> Symbols <- tolower(c("AAPL", "MSFT")) ## Whatever symbols you want
> symbols <- paste(Symbols, collapse=",")
>
> #what <- "datetime,bidsz,bid,ask,asksz,last,chg,pchg,opn,hi,lo,vl"
> what <- "cusip"
> what <- gsub(" ", "", tolower(paste(unlist(strsplit(what, ",")),
>                                       collapse=",")))
> tkURL <- "https://api.tradeking.com/v1/market/ext/quotes.json"
> query <- list(symbols=symbols, fids=what)
> response <- credentials$OAuthRequest(tkURL, query)
> res <- fromJSON(response)
> qt <- res$response$quotes$quote
> qt
>
> #[[1]]
> #     cusip       exch     symbol
> #"59491810"     "NASD"     "MSFT"
> #
> #[[2]]
> #     cusip       exch     symbol
> #"03783310"     "NASD"     "AAPL"
>
> HTH,
> Garrett
>



--
Anshul Vikram Pandey
+1-929-231-6784
home: www.anshulvp.com
thoughts: www.anshulvp.com/blog
contact: [hidden email], [hidden email]

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: CUSIP Numbers

Amos B. Elberg
In reply to this post by Anshul Pandey
I've always gotten CUSIPs from the finra website. I haven't tried to scrape them, but it shouldn't be terribly difficult with Hadley's rvest package.


> On Jan 21, 2015, at 10:45 AM, Anshul Pandey <[hidden email]> wrote:
>
> Hi All,
>
> I am moving some of my backtesting logics to CUSIP from tickers.
> How do I download the CUSIP number of US stocks?
>
> I know S&P has a paid subscription, but I read that CUSIP is publicly
> available at a few resources.
>
> Any suggestions are highly welcome.
>
> Thanks
> Anshul
>
>    [[alternative HTML version deleted]]
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.