mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 00:23:07 +00:00
chore: sort pairs by absolute profit
This commit is contained in:
@@ -515,14 +515,16 @@ def generate_strategy_stats(
|
||||
|
||||
best_pair = (
|
||||
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
|
||||
else None
|
||||
)
|
||||
worst_pair = (
|
||||
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
|
||||
else None
|
||||
|
||||
Reference in New Issue
Block a user