stop loss limit when hit, the close price is “average”

This commit is contained in:
misagh 2018-11-28 15:45:11 +01:00
parent fb755880fa
commit c913fef80c

View File

@ -256,7 +256,7 @@ class Trade(_DECL_BASE):
elif order_type == 'stop_loss_limit':
self.stoploss_order_id = None
logger.info('STOP_LOSS_LIMIT is hit for %s.', self)
self.close(order['price'])
self.close(order['average'])
else:
raise ValueError(f'Unknown order type: {order_type}')
cleanup()