diff --git a/zipline/finance/risk.py b/zipline/finance/risk.py index af94b284..f4bd736f 100644 --- a/zipline/finance/risk.py +++ b/zipline/finance/risk.py @@ -41,7 +41,7 @@ import datetime import math import numpy as np import numpy.linalg as la -import zipline.protocol as zp +from zipline.utils.date_utils import epoch_now LOGGER = logging.getLogger('ZiplineLogger') @@ -331,6 +331,7 @@ class RiskReport(): self.algorithm_returns = algorithm_returns self.trading_environment = trading_environment self.exceeded_max_loss = exceeded_max_loss + self.created = epoch_now() if len(self.algorithm_returns) == 0: start_date = self.trading_environment.period_start @@ -364,7 +365,8 @@ class RiskReport(): 'three_month' : [x.to_dict() for x in self.three_month_periods], 'six_month' : [x.to_dict() for x in self.six_month_periods], 'twelve_month' : [x.to_dict() for x in self.year_periods], - 'exceeded_max_loss' : self.exceeded_max_loss + 'exceeded_max_loss' : self.exceeded_max_loss, + 'created' : self.created } def periodsInRange(self, months_per, start, end):