diff --git a/catalyst/exchange/exchange_algorithm.py b/catalyst/exchange/exchange_algorithm.py index a05bb7a7..782b7ec8 100644 --- a/catalyst/exchange/exchange_algorithm.py +++ b/catalyst/exchange/exchange_algorithm.py @@ -129,7 +129,7 @@ class ExchangeTradingAlgorithmBase(TradingAlgorithm): @api_method def set_commission(self, maker=None, taker=None): - key = self.blotter.commission_models.keys()[0] + key = list(self.blotter.commission_models.keys())[0] if maker is not None: self.blotter.commission_models[key].maker = maker @@ -138,7 +138,7 @@ class ExchangeTradingAlgorithmBase(TradingAlgorithm): @api_method def set_slippage(self, spread=None): - key = self.blotter.slippage_models.keys()[0] + key = list(self.blotter.slippage_models.keys())[0] if spread is not None: self.blotter.slippage_models[key].spread = spread @@ -708,7 +708,7 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase): self.frame_stats = list() self.performance_needs_update = False - orders = self.perf_tracker.todays_performance.orders_by_id.keys() + orders = list(self.perf_tracker.todays_performance.orders_by_id.keys()) if orders != self._last_orders: self.performance_needs_update = True diff --git a/catalyst/exchange/exchange_blotter.py b/catalyst/exchange/exchange_blotter.py index 26b74457..d638e4bd 100644 --- a/catalyst/exchange/exchange_blotter.py +++ b/catalyst/exchange/exchange_blotter.py @@ -10,7 +10,6 @@ from catalyst.finance.transaction import create_transaction, Transaction from catalyst.utils.input_validation import expect_types from logbook import Logger from redo import retry -from six import iteritems log = Logger('exchange_blotter', level=LOG_LEVEL)