Merge pull request #59 from quantopian/fawce_alpha1

added a created date to the risk report.
This commit is contained in:
jbredeche
2012-05-29 18:26:22 -07:00
+4 -2
View File
@@ -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):