Skip to content

Commit c6ed647

Browse files
committed
chore: sort pairs by absolute profit
1 parent 8f4dfbf commit c6ed647

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

freqtrade/optimize/optimize_reports/optimize_reports.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,16 @@ def generate_strategy_stats(
515515

516516
best_pair = (
517517
max(
518-
[pair for pair in pair_results if pair["key"] != "TOTAL"], key=lambda x: x["profit_sum"]
518+
[pair for pair in pair_results if pair["key"] != "TOTAL"],
519+
key=lambda x: x["profit_total_abs"],
519520
)
520521
if len(pair_results) > 1
521522
else None
522523
)
523524
worst_pair = (
524525
min(
525-
[pair for pair in pair_results if pair["key"] != "TOTAL"], key=lambda x: x["profit_sum"]
526+
[pair for pair in pair_results if pair["key"] != "TOTAL"],
527+
key=lambda x: x["profit_total_abs"],
526528
)
527529
if len(pair_results) > 1
528530
else None

0 commit comments

Comments
 (0)