From 6d8a786214cb77a8858457ddeac3eeae88f310e9 Mon Sep 17 00:00:00 2001 From: fawce Date: Thu, 7 Jun 2012 13:53:45 -0400 Subject: [PATCH] updated performance to be trade by trade. --- zipline/finance/performance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zipline/finance/performance.py b/zipline/finance/performance.py index 5a2aeaef..f8380ae9 100644 --- a/zipline/finance/performance.py +++ b/zipline/finance/performance.py @@ -247,12 +247,12 @@ class PerformanceTracker(object): self.cumulative_performance.update_last_sale(event) self.todays_performance.update_last_sale(event) - - def handle_market_close(self): #calculate performance as of last trade self.cumulative_performance.calculate_performance() self.todays_performance.calculate_performance() + def handle_market_close(self): + # add the return results from today to the list of DailyReturn objects. todays_date = self.market_close.replace(hour=0, minute=0, second=0) todays_return_obj = risk.DailyReturn( @@ -503,7 +503,7 @@ class PerformancePeriod(object): 'capital_used' : self.period_capital_used, 'starting_value' : self.starting_value, 'starting_cash' : self.starting_cash, - 'ending_cash' : self.ending_cash, + 'cash' : self.ending_cash, 'portfolio_value' : self.ending_cash + self.ending_value, 'cumulative_capital_used' : self.cumulative_capital_used, 'max_capital_used' : self.max_capital_used,