BUG: fixed issue #147 related to python 3 compatibility

This commit is contained in:
Frederic Fortier
2018-01-09 11:32:44 -05:00
parent ac15413af8
commit a49cb55821
2 changed files with 3 additions and 4 deletions
+3 -3
View File
@@ -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
-1
View File
@@ -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)