[R] Problem in using bdh function for Govt tickers

David Reiner David.Reiner at xrtrading.com
Wed Jan 19 16:24:16 CET 2011


That's a Bloomberg issue, not RBloomberg:
use bdp() (point) instead of bdh() (history) or bds() (set)

> bdp(conn,ticker,c("PX_LAST","CPN"))
               PX_LAST   CPN
912828JV Govt       NA 0.875
912828JY Govt 100.0234 0.875

HTH,
David L. Reiner
XR Trading LLC

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of nikhil
Sent: Wednesday, January 19, 2011 3:11 AM
To: r-help at r-project.org
Subject: [R] Problem in using bdh function for Govt tickers



Hi, all



I wanted to fetch data from Bloomberg for govt bonds, and analyse it
further.

I am having trouble in getting data as when I use field=PX_LAST, it is
giving the prices but when I use field=CPN, or ISSUE_DT, it is not giving
the results and just bouncing back <NA> for that.



This is the piece of code:



> library(rJava)

Warning message:

package 'rJava' was built under R version 2.12.1

> library(RBloomberg)

> k<-as.POSIXct("2010-12-29")

>  field<-c("PX_LAST")

>  ticker<-c("912828JV Govt","912828JY Govt")

>  conn <- blpConnect()

R version 2.12.0 (2010-10-15)

rJava Version 0.8-8

RBloomberg Version 0.4-146

Java environment initialized successfully.

Looking for most recent blpapi3.jar file...

Adding C:\blp\API\APIv3\JavaAPI\v3.3.3.3\lib\blpapi3.jar to Java classpath

Bloomberg API Version 3.3.3.3

> data<-bdh(conn,ticker,field,k,k)

>  data

         ticker          date          PX_LAST

1 912828JV Govt 2010-12-29 100.0000

2 912828JY Govt 2010-12-29 100.0625

> field<-c("PX_LAST","CPN")

>  data<-bdh(conn,ticker,field,k,k)

>  data

         ticker          date           PX_LAST CPN

1 912828JV Govt 2010-12-29 100.0000 <NA>

2 912828JY Govt 2010-12-29 100.0625 <NA>

>



I am a new R user, I have looked over for a similar problem but dint find
any.

Any suggestions??


        [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


This e-mail and any materials attached hereto, including, without limitation, all content hereof and thereof (collectively, "XR Content") are confidential and proprietary to XR Trading, LLC ("XR") and/or its affiliates, and are protected by intellectual property laws.  Without the prior written consent of XR, the XR Content may not (i) be disclosed to any third party or (ii) be reproduced or otherwise used by anyone other than current employees of XR or its affiliates, on behalf of XR or its affiliates.

THE XR CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF ANY KIND.  TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, XR HEREBY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO THE XR CONTENT, AND NEITHER XR NOR ANY OF ITS AFFILIATES SHALL IN ANY EVENT BE LIABLE FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES, LOSS OF PROFITS AND TRADING LOSSES, RESULTING FROM ANY PERSON'S USE OR RELIANCE UPON, OR INABILITY TO USE, ANY XR CONTENT, EVEN IF XR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE.



More information about the R-help mailing list