From 0605cbb06eb26b4a879727447f2f76ea5fcd5232 Mon Sep 17 00:00:00 2001 From: Eugene Schava Date: Tue, 22 Jun 2021 12:20:12 +0300 Subject: [PATCH] make "/profit N" command output be consistent with "/daily" and "/status table" commands --- freqtrade/rpc/rpc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 2a7721af0..296793930 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -339,7 +339,10 @@ class RPC: self, stake_currency: str, fiat_display_currency: str, start_date: datetime = datetime.fromtimestamp(0)) -> Dict[str, Any]: """ Returns cumulative profit statistics """ - trades = Trade.get_trades([Trade.open_date >= start_date]).order_by(Trade.id).all() + trade_filter = \ + (Trade.is_open.is_(False) & (Trade.close_date >= start_date)) | \ + Trade.is_open.is_(True) + trades = Trade.get_trades(trade_filter).order_by(Trade.id).all() profit_all_coin = [] profit_all_ratio = []