DEV Add preemptive check that benchmark return exists.

This commit is contained in:
Thomas Wiecki
2015-02-10 14:54:52 +01:00
parent 999f21e5ae
commit a7188187e6
+5
View File
@@ -312,6 +312,11 @@ class PerformanceTracker(object):
else:
midnight = event.dt
if midnight not in self.all_benchmark_returns.index:
raise AssertionError(("Date %s not allocated in "
"all_benchmark_returns. Calendar "
"seems to mismatch with benchmark."
% midnight))
self.all_benchmark_returns[midnight] = event.returns
def check_upcoming_dividends(self, midnight_of_date_that_just_ended):