From 857a5d8a91c0c2d872c2276198cdc910dd639722 Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Wed, 31 Jan 2018 21:57:33 -0500 Subject: [PATCH] BUG: for issue #178, modified logic to track adjusted order amount --- catalyst/exchange/ccxt/ccxt_exchange.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/catalyst/exchange/ccxt/ccxt_exchange.py b/catalyst/exchange/ccxt/ccxt_exchange.py index 1f050f7f..2a677cd1 100644 --- a/catalyst/exchange/ccxt/ccxt_exchange.py +++ b/catalyst/exchange/ccxt/ccxt_exchange.py @@ -798,6 +798,14 @@ class CCXT(Exchange): ) raise ExchangeRequestError(error=e) + if 'amount' in result and result['amount'] != adj_amount: + log.info( + 'order amount adjusted by {} from {} to {}'.format( + self.name, adj_amount, result['amount'] + ) + ) + adj_amount = result['amount'] + if 'info' not in result: raise ValueError('cannot use order without info attribute') @@ -886,7 +894,7 @@ class CCXT(Exchange): def process_order(self, order): # TODO: move to parent class after tracking features in the parent - if not self.api.hasFetchMyTrades: + if not self.api.has['fetchMyTrades']: return self._process_order_fallback(order) try: