Switch performanceFilter to use Minutes lookback resolution

closes #5060
This commit is contained in:
Matthias
2021-09-18 08:36:06 +02:00
parent 12c12d42df
commit 564e0b9a1a
3 changed files with 7 additions and 7 deletions

View File

@@ -832,14 +832,14 @@ class Trade(_DECL_BASE, LocalTrade):
return total_open_stake_amount or 0
@staticmethod
def get_overall_performance(days=None) -> List[Dict[str, Any]]:
def get_overall_performance(minutes=None) -> List[Dict[str, Any]]:
"""
Returns List of dicts containing all Trades, including profit and trade count
NOTE: Not supported in Backtesting.
"""
filters = [Trade.is_open.is_(False)]
if days:
start_date = datetime.today() - timedelta(days)
if minutes:
start_date = datetime.now(timezone.utc) - timedelta(minutes=minutes)
filters.append(Trade.close_date >= start_date)
pair_rates = Trade.query.with_entities(
Trade.pair,