mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-04-29 05:20:10 +00:00
chore: autoformat actual code
This commit is contained in:
@@ -150,9 +150,7 @@ class TimeRange:
|
|||||||
starts = rvals[index]
|
starts = rvals[index]
|
||||||
if stype[0] == "date" and len(starts) == 8:
|
if stype[0] == "date" and len(starts) == 8:
|
||||||
start = int(
|
start = int(
|
||||||
datetime.strptime(starts, "%Y%m%d")
|
datetime.strptime(starts, "%Y%m%d").replace(tzinfo=UTC).timestamp()
|
||||||
.replace(tzinfo=UTC)
|
|
||||||
.timestamp()
|
|
||||||
)
|
)
|
||||||
elif len(starts) == 13:
|
elif len(starts) == 13:
|
||||||
start = int(starts) // 1000
|
start = int(starts) // 1000
|
||||||
@@ -163,9 +161,7 @@ class TimeRange:
|
|||||||
stops = rvals[index]
|
stops = rvals[index]
|
||||||
if stype[1] == "date" and len(stops) == 8:
|
if stype[1] == "date" and len(stops) == 8:
|
||||||
stop = int(
|
stop = int(
|
||||||
datetime.strptime(stops, "%Y%m%d")
|
datetime.strptime(stops, "%Y%m%d").replace(tzinfo=UTC).timestamp()
|
||||||
.replace(tzinfo=UTC)
|
|
||||||
.timestamp()
|
|
||||||
)
|
)
|
||||||
elif len(stops) == 13:
|
elif len(stops) == 13:
|
||||||
stop = int(stops) // 1000
|
stop = int(stops) // 1000
|
||||||
|
|||||||
@@ -1583,9 +1583,7 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
if not_closed:
|
if not_closed:
|
||||||
if fully_cancelled or (
|
if fully_cancelled or (
|
||||||
open_order
|
open_order
|
||||||
and self.strategy.ft_check_timed_out(
|
and self.strategy.ft_check_timed_out(trade, open_order, datetime.now(UTC))
|
||||||
trade, open_order, datetime.now(UTC)
|
|
||||||
)
|
|
||||||
):
|
):
|
||||||
self.handle_cancel_order(
|
self.handle_cancel_order(
|
||||||
order, open_order, trade, constants.CANCEL_REASON["TIMEOUT"]
|
order, open_order, trade, constants.CANCEL_REASON["TIMEOUT"]
|
||||||
|
|||||||
@@ -71,9 +71,7 @@ class PairLock(ModelBase):
|
|||||||
"lock_time": self.lock_time.strftime(DATETIME_PRINT_FORMAT),
|
"lock_time": self.lock_time.strftime(DATETIME_PRINT_FORMAT),
|
||||||
"lock_timestamp": int(self.lock_time.replace(tzinfo=UTC).timestamp() * 1000),
|
"lock_timestamp": int(self.lock_time.replace(tzinfo=UTC).timestamp() * 1000),
|
||||||
"lock_end_time": self.lock_end_time.strftime(DATETIME_PRINT_FORMAT),
|
"lock_end_time": self.lock_end_time.strftime(DATETIME_PRINT_FORMAT),
|
||||||
"lock_end_timestamp": int(
|
"lock_end_timestamp": int(self.lock_end_time.replace(tzinfo=UTC).timestamp() * 1000),
|
||||||
self.lock_end_time.replace(tzinfo=UTC).timestamp() * 1000
|
|
||||||
),
|
|
||||||
"reason": self.reason,
|
"reason": self.reason,
|
||||||
"side": self.side,
|
"side": self.side,
|
||||||
"active": self.active,
|
"active": self.active,
|
||||||
|
|||||||
@@ -125,9 +125,7 @@ class Order(ModelBase):
|
|||||||
@property
|
@property
|
||||||
def order_filled_utc(self) -> datetime | None:
|
def order_filled_utc(self) -> datetime | None:
|
||||||
"""last order-date with UTC timezoneinfo"""
|
"""last order-date with UTC timezoneinfo"""
|
||||||
return (
|
return self.order_filled_date.replace(tzinfo=UTC) if self.order_filled_date else None
|
||||||
self.order_filled_date.replace(tzinfo=UTC) if self.order_filled_date else None
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def safe_amount(self) -> float:
|
def safe_amount(self) -> float:
|
||||||
|
|||||||
Reference in New Issue
Block a user