I am trying to put together a universe that filters for the equities with an upcoming earnings date x days away. My code is below and shown for the day before (-1). I keep receiving the following error:
Runtime Error: The added or subtracted value results in an un-representable DateTime. Parameter name: value
Is it possible to do this? What am I missing here?
public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)
{
return fine.Where(x =>
// Filter for equities with earnings in x number of days
Time == x.EarningReports.FileDate.AddDays(-1) &&
// Invalid FileDate
x.EarningReports.FileDate != new DateTime())
.Take(1).Select(x => x.Symbol);
}