I want to use an external date variable to be used in the bdh formula of the pdblp package. But for some reason .format() is not working in this case.
startdate = '20130101'
df1 = con.bdh(['FV1 Comdty', 'TY1 Comdty'], 'FUT_EQV_DUR_NOTL', '{}', '20190630').format(startdate)
It gives me the following error
InvalidArgumentException: Choice sub-element not found for name 'securityData'. (0x00020002)
Why don't you just do?
df1 = con.bdh(['FV1 Comdty', 'TY1 Comdty'], 'FUT_EQV_DUR_NOTL', startdate, '20190630')