Update stoploss on exchange logic

closes #7424
This commit is contained in:
Matthias
2022-09-17 17:07:47 +02:00
parent 9f266cbcb2
commit 063511826c
3 changed files with 17 additions and 8 deletions

View File

@@ -376,6 +376,12 @@ class LocalTrade():
def open_date_utc(self):
return self.open_date.replace(tzinfo=timezone.utc)
@property
def stoploss_last_update_utc(self):
if self.stoploss_last_update:
return self.stoploss_last_update.replace(tzinfo=timezone.utc)
return None
@property
def close_date_utc(self):
return self.close_date.replace(tzinfo=timezone.utc)
@@ -560,7 +566,6 @@ class LocalTrade():
self.stop_loss = stop_loss_norm
self.stop_loss_pct = -1 * abs(percent)
self.stoploss_last_update = datetime.utcnow()
def adjust_stop_loss(self, current_price: float, stoploss: float,
initial: bool = False, refresh: bool = False) -> None: