Python / Bloomberg api – historical security data incl. weekends (sat. and sun.)

Question:

I’m currently working with an blpapi and trying to get a bdh of an index including weekends. (I’ll later need to match this df with another date vector.)
I’m allready using

con.bdh([Index],['PX_LAST'],'19910102', today.strftime('%Y%m%d'), [("periodicitySelection", "DAILY")])

but this will return only weekdays (mon – fr). I know how this works in excel with the bbg function-builder but not sure about the wording within the blpapi.

Since I’ll need always the first of each month,

con.bdh([Index],['PX_LAST'],'19910102', today.strftime('%Y%m%d'), [("periodicitySelection", "MONTHLY")])

wont work as well because it will return 28,30,31 and so.

Can anyone help here? THX!

Asked By: Karush Kuhn Tucker

||

Answers:

You can use a combination of:

"nonTradingDayFillOption", "ALL_CALENDAR_DAYS"  # include all days
"nonTradingDayFillMethod", "PREVIOUS_VALUE"     # fill non-trading days with previous value
Answered By: assylias
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.