Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pulling Portfolio Data From Bloomberg using R Package "Rblpapi”

Tags:

r

bloomberg

I am trying to pull portfolio data from Bloomberg using command getPortfolio(My Portfolio,"Portfolio_Data"). Is it Possible to indicate reference date in the command?

When using excel it is possible to extract a portfolio at a certain point in time using BDS(My Portfolio,"Portfolio_Data","reference date = date") function. I wonder if this is possible in R.

BDS command returns NULL when requesting portfolio data in R. It seems like getPortfolio() should be the right solution, however I cannot figure out how to incorporate date into the function.

like image 996
Nick Avatar asked Nov 22 '25 04:11

Nick


1 Answers

Figured out the correct syntax. The way to incorporate reference date into getPortfolio() function should look like the following:

overrides = c("REFERENCE_DATE" = '20181010')
getPortfolio("My Portfolio","Portfolio_Data", overrides = overrides)

"My Portfolio" should be portfolio ID from BBG's PRTU function with "client" appended (should look like this: "U1234567-8 Client")

like image 199
Nick Avatar answered Nov 23 '25 20:11

Nick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!