Rblp / Rblpapi

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

question | getBars #312

Open lz1nwm opened 4 years ago

lz1nwm commented 4 years ago

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

eddelbuettel commented 4 years ago

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.

lz1nwm commented 4 years ago

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

johnlaing commented 4 years ago

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.

eddelbuettel commented 4 years ago

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.

lz1nwm commented 4 years ago

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

johnlaing commented 4 years ago

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

entropy43 commented 4 years ago

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 commented 4 years ago

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

entropy43 commented 4 years ago

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.

johnlaing commented 4 years ago

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

wmorgan85 commented 4 years ago

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)

betomann commented 4 years ago

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.

entropy43 commented 4 years ago

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.