Bloomberg XBBG Python BDS function

Viewed 48

I am trying to print out the daily project index dividends, using the below code

df = blp.bds('AS51 Index','BDVD_PROJ_DIV_INDX_PTS',period='d',Start_Dt='20220912',End_Dt="2022091")
print(df)

As you can see I want to find the daily projected dividends for ASX200 cash index for between and inclusive of the 12 to the 19th of September 2022. However, the below is printed out:

              month/year  dividend_(in_index_points)
AS51 Index    09/2022                       5.986
AS51 Index    10/2022                       2.014
AS51 Index    11/2022                      30.205
AS51 Index    12/2022                      11.469
AS51 Index    01/2023                       0.310
AS51 Index    02/2023                      77.640
AS51 Index    03/2023                      31.440
AS51 Index    04/2023                       1.475
AS51 Index    05/2023                      30.285
AS51 Index    06/2023                      12.874

As you can see its showing the monthly dividend for the index rather then daily and outside of the date range requested. How best to solve?

1 Answers

As ever, AS51 Index FLDS on the Terminal will show you all the available fields and their override names.

Full code, using today's date as the start point (specifying dates in the past seems to yield inconsistent results)

from xbbg import blp
import datetime

start_date = datetime.date.today()
end_date = start_date + datetime.timedelta(days=7)

df = blp.bds('AS51 Index','BDVD_PROJ_DIV_INDX_PTS',
             PERIODICITY_OVERRIDE='D',
             START_DATE_OVERRIDE=start_date.strftime('%Y%m%d'),
             END_DATE_OVERRIDE=end_date.strftime('%Y%m%d'))

print(df)

With output (for me at least):

            month/year  dividend_(in_index_points)
AS51 Index  2022-09-22                        x.00
AS51 Index  2022-09-23                        x.00
AS51 Index  2022-09-24                        x.00
AS51 Index  2022-09-25                        x.00
AS51 Index  2022-09-26                        x.00
AS51 Index  2022-09-27                        x.00
AS51 Index  2022-09-28                        x.00
AS51 Index  2022-09-29                        x.61
Related