mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
chore: sort pairs by absolute profit
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user