mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Improve behavior for when stoploss cancels without content
closes #8761
This commit is contained in:
parent
1a4d94a6f3
commit
9a7794c520
|
@ -97,7 +97,7 @@ class Order(ModelBase):
|
|||
|
||||
@property
|
||||
def safe_filled(self) -> float:
|
||||
return self.filled if self.filled is not None else self.amount or 0.0
|
||||
return self.filled if self.filled is not None else 0.0
|
||||
|
||||
@property
|
||||
def safe_cost(self) -> float:
|
||||
|
@ -703,7 +703,7 @@ class LocalTrade():
|
|||
self.stoploss_order_id = None
|
||||
self.close_rate_requested = self.stop_loss
|
||||
self.exit_reason = ExitType.STOPLOSS_ON_EXCHANGE.value
|
||||
if self.is_open:
|
||||
if self.is_open and order.safe_filled > 0:
|
||||
logger.info(f'{order.order_type.upper()} is hit for {self}.')
|
||||
else:
|
||||
raise ValueError(f'Unknown order type: {order.order_type}')
|
||||
|
|
Loading…
Reference in New Issue
Block a user