Rblpapi icon indicating copy to clipboard operation
Rblpapi copied to clipboard

question | getBars

Open lz1nwm opened this issue 5 years ago • 13 comments

How to instruct getBars() to get yields instead of prices for FI instruments?

lz1nwm avatar Jul 23 '20 12:07 lz1nwm

You most likely "simply" want to retrieve a different column of data rather than PRICE. It should be entirely under the control of your query, and Rblpapi will faithfully send it off and get you the results. What you put into the query is your part. Consult Bloomberg help for assistance.

eddelbuettel avatar Jul 23 '20 12:07 eddelbuettel

ok... but could you please be more specific: which argument should be changed security=, options= or something else?

lz1nwm avatar Jul 23 '20 12:07 lz1nwm

I'm not sure this is possible for getBars, since there is no field specified. I'd be curious to hear a response from the helpdesk, but they've been a bit less than helpful recently.

Alternatively you could use bdp to convert prices to yield, but for any historical data you'll have to tweak the settlement date.

johnlaing avatar Jul 23 '20 12:07 johnlaing

Sorry, my bad. Forget the context of getBars(). Please ignore.

General context holds though. Rblpapi will bring you what is offered. Bloomberg is generally somewhat nebulous about which fields are there. For derived quantities like yield they may not be available at all resolutions, conventions, ... etc.

eddelbuettel avatar Jul 23 '20 12:07 eddelbuettel

Helpdesk said that they don't support programming languages...

lz1nwm avatar Jul 23 '20 14:07 lz1nwm

Yeah, that's been the official line last few times I've gone in. Unfortunate, really.

johnlaing avatar Jul 23 '20 14:07 johnlaing

I would first check out FLDS on the terminal and find / check the correct API call for the security you want yield for.

Once you've done that, then go to the helpdesk and ask them to help you construct the correct Excel API call.

From there, you should be able to back out from the Excel API code to the correct syntax and options for bdh or getBars or whatever.

entropy43 avatar Jul 23 '20 21:07 entropy43

If you get stuck, reply here and I will do my best to help you figure it out.

entropy43 avatar Jul 23 '20 21:07 entropy43

also @eddelbuttel / @johnlaing I think it would be good to have some examples of 'non-standard' queries for newcomers to refer to in the docs. I'm happy to do this.

entropy43 avatar Jul 23 '20 21:07 entropy43

Always in favor of more extensive documentation via examples. Feel free to open a separate issue if you'd like to take that on.

johnlaing avatar Jul 24 '20 01:07 johnlaing

If I remember rightly intraday bars will only return yield for yield quoted securities. In BDH there is a QuoteType parameter which accepts price/yield. There will be an equivalent in the v3 signature. Apologies for being vague but it has been a year since I left BBG (where I built some of the API functionality)

wmorgan85 avatar Jul 24 '20 13:07 wmorgan85

also @eddelbuttel / @johnlaing I think it would be good to have some examples of 'non-standard' queries for newcomers to refer to in the docs. I'm happy to do this.

Hi. 1st. thanks very much @eddelbuettel @johnlaing and @armstrtw for developing such a cool package. I'm quite new using it and I'm currently trying to consult intraday fixed-income yields. Is this possible? Please pardon me whether I missed something above.

betomann avatar Jul 27 '20 23:07 betomann

Again, if you can construct the query in the Excel API then, typically, you can construct it in Rblpapi

Get the helpdesk to solve your query in Excel first. Then try pasting what they give back to you here and someone may try to help you translate it.

entropy43 avatar Jul 27 '20 23:07 entropy43