Updateing order amount should use filled - not amount if possible

This commit is contained in:
Matthias 2020-03-24 19:53:50 +01:00
parent 19e5dbddc6
commit f04f606b70
1 changed files with 1 additions and 1 deletions

View File

@ -315,7 +315,7 @@ class Trade(_DECL_BASE):
if order_type in ('market', 'limit') and order['side'] == 'buy':
# Update open rate and actual amount
self.open_rate = Decimal(order['price'])
self.amount = Decimal(order['amount'])
self.amount = Decimal(order.get('filled', order['amount']))
self.recalc_open_trade_price()
logger.info('%s_BUY has been fulfilled for %s.', order_type.upper(), self)
self.open_order_id = None