fix NoneType issue

This commit is contained in:
gcarq 2017-12-16 01:31:15 +01:00
parent ae37f49b51
commit f4b59492ab

View File

@ -379,7 +379,7 @@ def _exec_forcesell(trade: Trade) -> None:
# Cancel open LIMIT_BUY orders and close trade
if order and not order['closed'] and order['type'] == 'LIMIT_BUY':
exchange.cancel_order(trade.open_order_id)
trade.close(order.get('rate', trade.open_rate))
trade.close(order.get('rate') or trade.open_rate)
# TODO: sell amount which has been bought already
return