Reducing overnight risk by avoiding trades around next earnings date
Author: techtrader007
Creation Date: 12/15/2010 3:22 PM
profile picture

techtrader007

#1
to avoid trades before and after earnings announcement with yahoo earnings calendar.
Has someone create a filter entry like this in a script?
Thanks.
profile picture

Eugene

#2
Sure. Not exactly Yahoo Earnings calendar but you can choose from these 3 other next earnings date sources using these methods already in Community.Components:

#1 - Get symbol data from Finviz.com (company name, sector, industry, next earnings date)
#2,3 - GetNextEarningsDate
profile picture

techtrader007

#3
How can I build a condition to sort out one day before and one day after the earnings announcement to avoid any trade?
And for backtesting issues are there any historical files available for example the NAS100.
Thanks.
profile picture

Eugene

#4
QUOTE:
How can I build a condition to sort out one day before and one day after the earnings announcement to avoid any trade?

The methods return a DateTime object that you should use to compare the Date with the current bar's date. Check out this very helpful site: C# DateTime Examples, Finding yesterday/tomorrow.
profile picture

techtrader007

#5
Thanks. Good report.
By the way behind this function DateTime nextDate = Utility.GetNextEarningsDate(Bars.Symbol) is there are historical file behind, if I run it through your script with the condition one day before and one day after, like if (Bars.Date[bar] != nextDate.AddDays(-1)) and so on or is this only a one moment view to see the next earnings date.
profile picture

Eugene

#6
There are no historical dates. It's forward looking only.
profile picture

Gamba

#7
Is there a way to get past earnings dates for backtest without FidelityFundamenatlData?
I'm am not a WL Pro customer.
profile picture

Eugene

#8
Of our existing data providers, no free/paid fundamental data vendor that I know timestamps their fundamental items with actual earnings release dates. So unless I'm mistaken, extracting the date from the data (of YCharts, MSN, or Moneycentral) would not help.

The good news is that there is a suitable data source, and I need to work on a method to extract the historical earnings dates. Let me see what can be done. I'll keep you posted.
profile picture

Eugene

#9
I just have created a new free fundamental data provider for earnings.com earnings releases. It has a good range of past earnings release dates (precise). In addition, there are estimate/actual EPS amount.

It will be included in MS123 Extra Fundamental/News Providers shortly.
profile picture

Eugene

#10
Here's how to use the new provider to get past earnings dates in a Strategy:

Earnings.com Fundamental Provider: extended Earnings data > code example
profile picture

Gamba

#11
Eugene, great work. Thank you for implementing the past earnings dates.
Two additional question to this topic:

1) I only get data back to 2005. At Earnings.com I see data till 1999.
But before 2005 there are no values for EPS, only the dates. Maybe this is the cause that
I can only get dates till 2005. Would it be possible to request the dates back to 1999?
The values of EPS is not that interesting to me.

2) In the chart I don't see the 'E' for earnings at overlay. Alle earnings and othe fundamental items
are displayed on a separate pane. Do I have to set some preferences for it to see an overlay?

Please see this image for both points mentioned above.

profile picture

Eugene

#12
QUOTE:
2) In the chart I don't see the 'E' for earnings at overlay.

These are activated on an individual basis in Wealth-Lab's Preferences dialog > Chart Annotations. The item of interest is "[e] eps".
QUOTE:
1) I only get data back to 2005. At Earnings.com I see data till 1999.
+
Would it be possible to request the dates back to 1999?
The values of EPS is not that interesting to me.

Currently, it is only possible if the item at earnings.com has a date and a valid EPS value (not a "n/a"). This is a fundamental provider usable by everyone, so it has to comply with the guidelines e.g. each fundamental item must have a double value. If it is "n/a" at earnings.com, the provider will consider the item incomplete and skip it.

Anticipating your potential question: a fictional double value like "0.0" couldn't be a good/reliable substitute when the stock has a "n/a" earnings. I'd find this a falsification of data.

On the bright side, I see a workaround: assign a minimum double value (aka .NET Double.MinValue constant, -1.7976931348623157E+308). This would allow invalid EPS items to be accessible on charts and backtests.

EDIT

I uploaded a hotfix to the data provider, allowing you to utilize all EPS values including n/a. Please update the extension using the Extension Manager.
profile picture

Gamba

#13
Ok, I understand your point of view, but I only want to take no trades when there are earnings,
so I only need the date, not the value of EPS.

If I understand you right, I have to update my DataSet and after this I will get
all available earnings dates and for those without a value I will get a Double.MinValue
in detail?
profile picture

Eugene

#14
Yes, that's right. Using version 2013.01.1 of the extension, you should get all earnings releases for a stock with the Double.MinValue for those with n/a in the data in addition to the regular EPS values (starting from 2005).
profile picture

Gamba

#15
Nice job, Eugene, thanks a lot.
profile picture

kiewo

#16
I have a question regarding the Earnings.com Fundamental Provider.

How can I compare Date[bar] with a historical earnings date of a specific symbol?
The meaning of it is to exclude trades in front of earnings.

profile picture

Eugene

#17
Please see the first code sample on this page:

Earnings Date Helper

Substitute two occasions of "earnings per share" with "[e] eps" after updating a DataSet with Earnings.com provider checked in the "Fundamental providers" list (Data Manager > Update Data).

It illustrates how to use the EarningsDate.InWindow method to indicate if the symbol is within the "earnings window" of the specified number of days before and/or after it.
profile picture

kiewo

#18
I've got it!
Thank you very much!
profile picture

Eugene

#19
ATTENTION

With the earnings.com website acquired by Reuters and the subsequent demise of their earnings data feed, the Earnings.com data provider is now broke beyond repair. It will not deliver any data. We're removing this provider in a new update of MS123 Extra Fundamental/News.
profile picture

Gamba

#20
Is or will there be another way to get the next earnings date?
These function is essential for most of my strategies and I'm using GetNextDateFromEarningscom.
With upgrade to new Community.Components it I need something similar to request the next future
earnings date to skip a trade some days before earnings.
profile picture

Eugene

#21
profile picture

Gamba

#22
Ok, sorry for the misleading post. Please see post #8.
I need the historical earnings dates and that was the reason why you implemented the earnings.com provider api.

Now, without the earnings.com provider I only can request the next future earnings date, and this is not suitable for backtest purposes.
As you wrote above there is no free data provider to get the past earnings.

So what are my alternatives to earnings.com to not broke my strategies?
I would be very comfortable to get another data source implemented to get all available the past earnings.
profile picture

Eugene

#23
If you or anybody else interested in this finds an alternative free data source that satisfies your parameters, let the forum know and we'll see if creating an earnings.com replacement is possible or not.
profile picture

Gamba

#24
Maybe http://www.zacks.com is a possible solution. You can get the earnings date per URL per company.
So it could be a way to get the date only, for example: http://www.zacks.com/stock/research/ORCL/earnings-announcements

On the other hand I can only see data back to 2009 ...
profile picture

Eugene

#25
Agreed, that would made a good replacement. Although limited on the data range, there's no alternative I could find that has true datestamps. Fortunately for you, I just stumbled onto the fulldisclosure.com website, branded by Reuters, which seems to be the good old earnings.com!

http://www.fulldisclosure.com/company.asp?ticker=ORCL&client=cb

I rebuilt the provider and it works like before. :) Right now the extension might not be updated by the Extension Manager but you'll be able to update later today or tomorrow when we fix this minor issue. Should this website share the destiny of earnings.com (i.e. goes down), I'll look into the Zacks alternative.
profile picture

Eugene

#26
ATTENTION

The earnings.com fundamental data provider has been restored as the data feed was discovered at a different URL: fulldisclosure.com. While it's available, the provider will operate exactly as before.
profile picture

Gamba

#27
Nice job, Eugene. I will look forward to upgrade to the new version and test the same strategy code as before.

After downloading the data with DataManager again it works as expected.

FYI: You did not migrate the method EarningsDate.GetNextDateFromEarningscom but this is ok for me.
I'm able to use the following method Utility.GetNextEarningsDate(Bars.Symbol)
profile picture

Eugene

#28
Thanks for the reminder. I've uploaded the update to Community Components which will be available shortly.
profile picture

Eugene

#29
ATTENTION

As fulldisclosure.com is not loading right now, it appears that Reuters has pulled the plug on this domain too. Should this change be permanent, the Earnings.com fundamental data provider will be excluded from MS123 Extra Fundamental/News package and GetNextDateFromEarningscom will leave C.Components - now for good.

For more information and discussion, see this thread: MS123 Extra Fundamental/News providers
profile picture

Eugene

#30
ATTENTION

The Earnings.com provider has been withdrawn due to data feed demise. On the bright side, I've added a "replacement" data provider to MS123 Extra Fundamental/News providers:

99wallstreet.com earnings data provider

Its data loading depth is pretty short (since 2009), though. But it offers extended earnings data.
profile picture

Eugene

#31
ATTENTION

The Earnings.com provider will be up and running again in upcoming version of the library (for how long?)
profile picture

Eugene

#32
Effective 2015.07, the Earnings.com fundamental data provider will be permanently removed from the library due to web data feed shutdown.
profile picture

Eugene

#33
Attention: 99WallStreet provider does not deliver data as the data feed itself has been broken (missing years in the timestamps).
profile picture

Eugene

#34
ATTENTION

New provider StreetInsider should bring back quality and free earnings data. Look for it in MS123 Fundamental/News provider library v2015.07.

Paid alternative: Zacks data through Quandl provider
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).