From c8e6dad9cdec45493b999363032765b5fc5e0e8e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 15 Oct 2022 12:00:20 +0200 Subject: [PATCH] use exit_reason to determine left open trades --- freqtrade/optimize/optimize_reports.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/optimize/optimize_reports.py b/freqtrade/optimize/optimize_reports.py index 8dafe2e41..c406f866b 100644 --- a/freqtrade/optimize/optimize_reports.py +++ b/freqtrade/optimize/optimize_reports.py @@ -408,10 +408,10 @@ def generate_strategy_stats(pairlist: List[str], exit_reason_stats = generate_exit_reason_stats(max_open_trades=max_open_trades, results=results) - left_open_results = generate_pair_metrics(pairlist, stake_currency=stake_currency, - starting_balance=start_balance, - results=results.loc[results['is_open']], - skip_nan=True) + left_open_results = generate_pair_metrics( + pairlist, stake_currency=stake_currency, starting_balance=start_balance, + results=results.loc[results['exit_reason'] == 'force_exit'], skip_nan=True) + daily_stats = generate_daily_stats(results) trade_stats = generate_trading_stats(results) best_pair = max([pair for pair in pair_results if pair['key'] != 'TOTAL'],