Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Derek-Ych-Qi opened this issue Oct 10, 2017 · 10 comments

Comments

@Derek-Ych-Qi
Copy link

Derek-Ych-Qi commented Oct 10, 2017

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?

@eddelbuettel
Copy link
Member

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.

@joel23888
Copy link
Contributor

@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

@pb360
Copy link

pb360 commented Apr 17, 2018

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

@joel23888
Copy link
Contributor

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.

@changshun
Copy link

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.

@eddelbuettel
Copy link
Member

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.

@pb360
Copy link

pb360 commented Feb 27, 2019 via email

@changshun
Copy link

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.

@sorin-pascu
Copy link

sorin-pascu commented Dec 18, 2020

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 !

@gmonaie
Copy link

gmonaie commented Oct 27, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants