Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Remove Stocks that are close to Earnings Releases

I would like to create a pipeline that removes stocks that are +/- 5 days within earnings announcements:

This question has been raised a number of times in this forum but since the functions for businessDaysSinceEarnings has changed so much over time, none of the older solutions works for me.

This seems to work after the announcement but I cannot remove stocks that are about to announce:

bdays_since_release = BusinessDaysSincePreviousEvent(inputs=[fe.Actuals.slice('EPS', 'qf', 0).asof_date])  
made_public_n_days_ago  =  (bdays_since_release > 5)