These could be properties.

This commit is contained in:
Reigo Reinmets
2022-01-13 20:31:03 +02:00
parent 13bc5c5d8f
commit ffe69535d8
4 changed files with 12 additions and 9 deletions

View File

@@ -476,8 +476,9 @@ class FreqtradeBot(LoggingMixin):
current_rate = self.exchange.get_rate(trade.pair, refresh=True, side="buy")
current_profit = trade.calc_profit_ratio(current_rate)
# FIXME This is only here to lazyload orders.
trade.nr_of_successful_buys()
# TODO: Is there a better way to force lazy-load?
len(trade.orders)
min_stake_amount = self.exchange.get_min_pair_stake_amount(trade.pair,
current_rate,
self.strategy.stoploss)

View File

@@ -614,6 +614,7 @@ class LocalTrade():
else:
return None
@property
def nr_of_successful_buys(self) -> int:
"""
Helper function to count the number of buy orders that have been filled.
@@ -623,6 +624,7 @@ class LocalTrade():
o.status in NON_OPEN_EXCHANGE_STATES and
(o.filled or 0) > 0])
@property
def nr_of_successful_sells(self) -> int:
"""
Helper function to count the number of sell orders that have been filled.