From 6f1cbcbc4ffdd021078fea6e2bbefc3b773cc275 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Mon, 25 Mar 2013 12:40:19 -0400 Subject: [PATCH] MAINT: Moves internal state variables in performance tracker. Slight refactoring of grouping the tracking variables in the PerformanceTracker together. So that it's easier to see which are config members and which are members used to track internal state. --- zipline/finance/performance.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/zipline/finance/performance.py b/zipline/finance/performance.py index b11017be..3eb3355a 100644 --- a/zipline/finance/performance.py +++ b/zipline/finance/performance.py @@ -157,14 +157,8 @@ class PerformanceTracker(object): first_day = self.sim_params.first_open self.market_open, self.market_close = \ trading.environment.get_open_and_close(first_day) - self.progress = 0.0 self.total_days = self.sim_params.days_in_period - # one indexed so that we reach 100% - self.day_count = 0.0 self.capital_base = self.sim_params.capital_base - self.returns = [] - self.txn_count = 0 - self.event_count = 0 self.cumulative_risk_metrics = \ risk.RiskMetricsIterative(self.period_start) @@ -193,6 +187,13 @@ class PerformanceTracker(object): serialize_positions=True ) + self.returns = [] + # one indexed so that we reach 100% + self.day_count = 0.0 + self.txn_count = 0 + self.event_count = 0 + self.progress = 0.0 + def __repr__(self): return "%s(%r)" % ( self.__class__.__name__,