mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-27 20:51:34 +08:00
BUG: fixed issue #147 related to python 3 compatibility
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user