From 91e5abbc446304a6e58eedcc4163c00e486bc726 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Mon, 6 May 2013 17:35:44 -0400 Subject: [PATCH] MAINT: Use a for loop for main algorithm run loop instead of `list` So that stepping through a debugger is a little easier, with respect to having easy access to the algorithm object, and seeing which step in `self.gen` the interpreter is currently at. --- zipline/algorithm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 23527cda..6f26cdad 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -298,7 +298,9 @@ class TradingAlgorithm(object): # loop through simulated_trading, each iteration returns a # perf dictionary - perfs = list(self.gen) + perfs = [] + for perf in self.gen: + perfs.append(perf) # convert perf dict to pandas dataframe daily_stats = self._create_daily_stats(perfs)