Hi,
I am trying to pull ex-dividend dates for various equities using Fundamentals.dps_exdate.latest, however, this is returning ex-dividend dates that are lagging by two quarters instead of the latest quarter. I verified the ex-dates by checking IBM's website so the data is not completely incorrect. I am just wondering if it has the wrong timestamp.
Additionally, I am trying to calculate the number of days since or before the ex-dividend dates using the BusinessDaysUntilNextEvent() and BusinessDaysSincePreviousEvent() functions, however, these functions are returning the wrong numbers as well.
Here is my code:
ex_div_date = Fundamentals.dps_exdate.latest
close_price = USEquityPricing.close.latest
div_payout_amt = Fundamentals.dps_secs_qf.latest
# Factor computing number of days since most recent asof_date
# per asset.
days_since_div = BusinessDaysSincePreviousEvent(
inputs=[Fundamentals.dps_exdate_qf.latest]
)
days_until_div = BusinessDaysUntilNextEvent(
inputs=[Fundamentals.dps_exdate_qf.latest]
)
# Filter returning True for each asset whose most recent asof_date
# was in the last 5 business days.
recency_filter = (days_since_div <= 5)
IBM = StaticAssets(symbols(['IBM']))
tradeable_days = (days_since_div <= 1000)
final_filter = tradeable_days & IBM
pipe = Pipeline(
columns={
'ex-div_date': ex_div_date,
#'close price': close_price,
#'div_amt': div_payout_amt,
'days_since_div': days_since_div,
'days_until_div': days_until_div,
},
screen= final_filter
)
Can someone help me understand these results? Not sure if I am misunderstanding these factors or if the data is incorrect. I am completely stumped and have been searching for a possible explanation.
current date in pipeline (on the left) ex-div_date (on the right)
2015-01-05 00:00:00+00:00 Equity(3766 [IBM]) 2014-08-06
2015-01-06 00:00:00+00:00 Equity(3766 [IBM]) 2014-08-06
2015-01-07 00:00:00+00:00 Equity(3766 [IBM]) 2014-08-06
2015-01-08 00:00:00+00:00 Equity(3766 [IBM]) 2014-08-06
2015-01-09 00:00:00+00:00 Equity(3766 [IBM]) 2014-08-06
as you can see, the date on the right is lagging by two quarters, instead of lagging by one quarter.
also, the days until and days since are completely wrong since clearly, (2015-01-05) - (2014-08-06) = 152, not 108 as shown. The days_until column should also be increasing, not decreasing.
days since (left) days until(right)
2015-01-05 00:00:00+00:00 Equity(3766 [IBM]) 108.0 -108.0
2015-01-06 00:00:00+00:00 Equity(3766 [IBM]) 109.0 -109.0