[R-SIG-Finance] RBloomberg

Robert Sams robert at sanctumfi.com
Thu Feb 28 13:22:24 CET 2008


Hi,

To my knowledge, the Bloomberg API does not provide the functionality of
timeseries snapped at a user-specified timestamp (if I'm mistaken on
this point, please let me know and I'll incorporate this into
RBloomberg). This is unfortunate, but we have two second-best options.
The first is security specific. Some securities allow you to add a data
source modifier to the ticker that provides some flexibility with
regards to historical timestamps. For example, the 2y USD swap rate:

blpGetData(conn, c("USSW2 CMN3 CURNCY","USSW2 CMPN CURNCY"), "PX_LAST",
start=chron("2/20/8"))
         USSW2 CMN3 CURNCY USSW2 CMPN CURNCY
02/20/08            3.0065            2.9945
02/21/08            2.8560            2.8360
02/22/08            2.8925            2.9225
02/25/08            2.9950            2.9980
02/26/08            2.8910            2.8795
02/27/08            2.8340            2.8245
02/28/08                NA            2.7650

The provider codes CMN3 and CMPN are the Bloomberg composite 3pm and 5pm
New York close rates, respectively. This is not a general solution,
however and the timestamps available via provider codes are limited and
vary from security to security. (Please don't ask me how you can find
5pm GMT prices for your favourite stock because I don't know and you
should be asking Bloomberg such questions.)

The second, more general solution is to make an intraday bar call:

blpGetData(conn, "EDH8 COMDTY", c("BID","ASK"),
start=chron("2/27/08","14:59:00"), end=chron("2/27/08","15:00:00"),
barfields="LAST_PRICE", barsize=1)
                    BID.LAST_PRICE ASK.LAST_PRICE
(02/27/08 14:59:00)          97.05         97.055


This gives you the market at 3pm (london time on my terminal). This
solution is general in the sense that you can do this for any security
for which bloomberg provides intraday historical pricing. The downside
is that it's cumbersome and Bloomberg will only give you data going back
50 days.

If anyone is aware of another solution, please post it here.

Cheers, 
Robert 




-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of
guillaume.nicoulaud at halbis.com
Sent: 27 February 2008 09:19
To: r-sig-finance at stat.math.ethz.ch
Subject: [R-SIG-Finance] RBloomberg


Dear all,
Using RBloomberg, how do I get historical prices, one per day, but
always at a certain time (17:00h for example)?
Thanks


Les informations contenues dans ce message sont confidentielles et
peuvent constituer des informations privilegiees. Si vous n etes pas le
destinataire de ce message, il vous est interdit de le copier, de le
faire suivre, de le divulguer ou d en utiliser tout ou partie. Si vous
avez recu ce message par erreur, merci de le supprimer de votre systeme,
ainsi que toutes ses copies, et d en avertir immediatement l expediteur
par message de retour.
Il est impossible de garantir que les communications par messagerie
electronique arrivent en temps utile, sont securisees ou denuees de
toute erreur ou virus. En consequence, l expediteur n accepte aucune
responsabilite du fait des erreurs ou omissions qui pourraient en
resulter.
--- ----------------------------------------------------- --- The
information contained in this e-mail is confidential...{{dropped:3}}

_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. 
-- If you want to post, subscribe first.



More information about the R-SIG-Finance mailing list