Rblp / Rblpapi

R package interfacing the Bloomberg API from https://www.bloomberglabs.com/api/
Other
166 stars 75 forks source link

Formula question #315

Closed cnordenlow closed 3 years ago

cnordenlow commented 3 years ago

Hi, appreciate this package a lot. I´m trying to recreate a formula I that I in excel to import yield on a WIT US Treasury, just before the auction is finished. I do have this formula in excel that I´m using, before I put too much time on it, is it possible to recreate this formula using your package in R?

=BDH("WIT30 Govt";"Open";"2020-08-13 12:59:30";"2020-08-13 13:00:00";"Dir=V";"BarTp";"Bid";"TZ=New_York";"Dts=S")

Appreciate your support.

/Chris

johnlaing commented 3 years ago

In the API this is a bars request (which is different than other historical data requests). Try something like this: getBars("WIT30 Govt", "BID", startTime = as.POSIXct("2020-08-13 12:59:30"), endTime = as.POSIXct("2020-08-13 13:00:00"))

cnordenlow commented 3 years ago

Thanks, will try that.