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.
This commit is contained in:
Eddie Hebert
2013-03-25 12:40:19 -04:00
parent 19a1279385
commit 6f1cbcbc4f
+7 -6
View File
@@ -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__,