chore: sort pairs by absolute profit

This commit is contained in:
Matthias
2025-07-16 20:22:56 +02:00
parent 8f4dfbf55d
commit c6ed64746c

View File

@@ -515,14 +515,16 @@ def generate_strategy_stats(
best_pair = ( best_pair = (
max( max(
[pair for pair in pair_results if pair["key"] != "TOTAL"], key=lambda x: x["profit_sum"] [pair for pair in pair_results if pair["key"] != "TOTAL"],
key=lambda x: x["profit_total_abs"],
) )
if len(pair_results) > 1 if len(pair_results) > 1
else None else None
) )
worst_pair = ( worst_pair = (
min( min(
[pair for pair in pair_results if pair["key"] != "TOTAL"], key=lambda x: x["profit_sum"] [pair for pair in pair_results if pair["key"] != "TOTAL"],
key=lambda x: x["profit_total_abs"],
) )
if len(pair_results) > 1 if len(pair_results) > 1
else None else None