Sell filled amount or an open limit buy order in forcesell.

Currently forcesell only cancels an open limit buy order and doesn't sell the filled amount.

After this change, forcesell will also update trade's amount to filled amount and sell the filled amount.
This commit is contained in:
Pan Long
2018-05-25 22:29:06 +08:00
parent 4e0b095f2b
commit a98fcee4f9
2 changed files with 33 additions and 7 deletions

View File

@@ -316,8 +316,10 @@ class RPC(object):
and order['side'] == 'buy':
exchange.cancel_order(trade.open_order_id, trade.pair)
trade.close(order.get('price') or trade.open_rate)
# TODO: sell amount which has been bought already
return
# Do the best effort, if we don't know 'filled' amount, don't try selling
if order['filled'] is None:
return
trade.amount = order['filled']
# Ignore trades with an attached LIMIT_SELL order
if order and order['status'] == 'open' \