Rblpapi icon indicating copy to clipboard operation
Rblpapi copied to clipboard

Error in bdh_Impl(con, securities, fields, start.date, end.date, options, : Choice sub-element not found for name 'securityData'.

Open Derek-Ych-Qi opened this issue 8 years ago • 10 comments

connector<-blpConnect() bdh("AAPL US EQUITY", start.date = Sys.Date() - 365, end.date = Sys.Date(), fields = "RK003", con = connector) I simply called the code above but get this type of error. What does that mean?

Derek-Ych-Qi avatar Oct 10 '17 17:10 Derek-Ych-Qi

No idea what is RK003 supposed to be.

R> bdh("AAPL US Equity", fields="PX_LAST", start.date=Sys.Date()-7, end.date=Sys.Date()-1)
        date PX_LAST
1 2017-10-03  154.48
2 2017-10-04  153.48
3 2017-10-05  155.39
4 2017-10-06  155.30
5 2017-10-09  155.84
R> 

bdh() works fine for me.

eddelbuettel avatar Oct 10 '17 18:10 eddelbuettel

@Derek-Ych-Qi your code works as-is for me:

> connector<-blpConnect() 
> bdh("AAPL US EQUITY", start.date = Sys.Date() - 365, end.date = Sys.Date(), fields = "RK003", con = connector)
          date  RK003
1   2016-10-11 22.796
2   2016-10-12 22.832
...
252 2017-10-10 19.575

I suggest you ask BBG about your data permissions. Also why not use the more descriptive field name, which is VOLATILITY_60D? You will get the same results.

> connector<-blpConnect() 
> d<-bdh("AAPL US EQUITY", start.date = Sys.Date() - 365, end.date = Sys.Date(), fields = "RK003", con = connector)
> d1<-bdh("AAPL US EQUITY", start.date = Sys.Date() - 365, end.date = Sys.Date(), fields = "VOLATILITY_60D", con = connector)
> identical(d$RK003,d1$VOLATILITY_60D)
[1] TRUE

joel23888 avatar Oct 11 '17 00:10 joel23888

Hello @eddelbuettel I have ran into the same problem as mentioned in the topic of this post. I have done some looking into the topic and I saw you commented on another post that there could be settings in the terminal itself causing issues. Any chance you could elaborate further on this?

Best, Paul

pb360 avatar Apr 17 '18 18:04 pb360

Can you see the data in your terminal? If not check your data permissions. Also try an alternative field name for this as I mentioned above.

joel23888 avatar Apr 19 '18 01:04 joel23888

BABA <- bdh(securities = 'BABA US EQUITY','PX_LAST',start.date = as.Date('2019-01-01'),overrides = c('FX'='CNY')) it raised the same error when I run the above code.

changshun avatar Feb 27 '19 05:02 changshun

Try turning verbose=TRUE to see more. In most cases it means that if some data came back in came in a form that upset our parsing.

eddelbuettel avatar Feb 27 '19 11:02 eddelbuettel

Thanks Dirk, also thanks for making the package. Really appreciated.

On Wed, Feb 27, 2019 at 6:26 AM Dirk Eddelbuettel [email protected] wrote:

Try turning verbose=TRUE to see more. In most cases it means that if some data came back in came in a form that upset our parsing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Rblp/Rblpapi/issues/246#issuecomment-467826454, or mute the thread https://github.com/notifications/unsubscribe-auth/AHbOArU-BP_J89N9AkTR3SeQ9JPKzlsJks5vRmtRgaJpZM4P0UC4 .

pb360 avatar Feb 27 '19 18:02 pb360

Thanks @eddelbuettel , by running BABA <- bdh(securities = 'BABA US EQUITY','PX_LAST',start.date = as.Date('2019-01-01'),overrides = c('currency'='CNY')), I get the right result.

changshun avatar Mar 19 '19 03:03 changshun

Same problem with economic indicators. They are not returned, and setting verbose = TRUE doesn’t give details about what could be overwritten:

bdh("ROGDESD Index", "PX_LAST", start.date="2020-01-01", verbose = TRUE)

gives the error mentioned above. I hoped the code in Python will show me details but, alas, it works:

blp.bdh(tickers='ROGDESD Index', flds=['PX_LAST', 'last_price'],start_date='2020-01-01', )

returns both (identical) values: 'PX_LAST' and 'last_price'. Any help is appreciated! thanks @eddelbuettel !

sorin-pascu avatar Dec 18 '20 09:12 sorin-pascu

You can get this message from bdh() if you've breached a request limit. The terminal condition becomes apparent if you try to use getBars() instead of bdh(), you'll then get a proper request limit error message.

gmonaie avatar Oct 27 '21 01:10 gmonaie