Updateing order amount should use filled - not amount if possible
This commit is contained in:
parent
19e5dbddc6
commit
f04f606b70
@ -315,7 +315,7 @@ class Trade(_DECL_BASE):
|
|||||||
if order_type in ('market', 'limit') and order['side'] == 'buy':
|
if order_type in ('market', 'limit') and order['side'] == 'buy':
|
||||||
# Update open rate and actual amount
|
# Update open rate and actual amount
|
||||||
self.open_rate = Decimal(order['price'])
|
self.open_rate = Decimal(order['price'])
|
||||||
self.amount = Decimal(order['amount'])
|
self.amount = Decimal(order.get('filled', order['amount']))
|
||||||
self.recalc_open_trade_price()
|
self.recalc_open_trade_price()
|
||||||
logger.info('%s_BUY has been fulfilled for %s.', order_type.upper(), self)
|
logger.info('%s_BUY has been fulfilled for %s.', order_type.upper(), self)
|
||||||
self.open_order_id = None
|
self.open_order_id = None
|
||||||
|
Loading…
Reference in New Issue
Block a user