EarningsDate.InWindow does not distinguish between earnings reported before open vs after close
Author: DouglasMShaffer
Creation Date: 2/14/2018 8:11 PM
profile picture

DouglasMShaffer

#1
I am using a trading strategy based on earnings gap and entering when the price moves outside the range of the gap day.

I am trying to use EarningsDate.InWindow(this,bar,"earnings per share",0,0)

The last earnings for ABBV was 1/26/2018 Before Open & the function returns the bar for 1/26/2018. The bar for 1/26/2018 accounts for the change due to earnings.

The last earnings for AAPL was 2/1/2018 After Close & the function returns the bar for 2/12018. The bar for 2/1/2018 does not account for the change due to earnings. I need to look at the next bar.

Is there a way to overcome this problem to determine what earnings actually occurred?
profile picture

Eugene

#2
The EarningsDate class supports failover between several earnings data sources. Problem is, not every data source returns the time when earnings actually occurred. Now (just) one of them does. If I make the method return the time part it won't always do it if the primary feed's inaccessible for some reason. This might make it more error prone and less robust.

Since this is his creature, I leave it up to Cone to decide if we should account for the time of day in the method or it's not going to work.
profile picture

Eugene

#3
Currently, EarningsDate checks EarningsWhispers and CNN websites but only the former can return the earnings date timestamped with the real time of release. As a low-impact workaround I can make the GetNext method return the time part (optionally).

The idea is that your system makes a check with EarningsDate.InWindow as usual and if it returns true, make the extra request to GetNext():

CODE:
Please log in to see this code.


If Cone won't disagree I can commit this change in v2018.03 of the library.
profile picture

Eugene

#4
Douglas, the provider has been updated. Starting from v2018.03 you can now call the GetNext method as shown in post #3 above and extract the true time of an earnings announcement as reported by EarningsWhispers.
Note that the backup GetNext2 does not support it for reason expressed in the same post.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).