mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Simplify generate_tag_metrics logic
This commit is contained in:
parent
b8a4752636
commit
1b2cfc9857
|
@ -157,12 +157,11 @@ def generate_tag_metrics(
|
||||||
tabular_data = []
|
tabular_data = []
|
||||||
|
|
||||||
if tag_type in results.columns:
|
if tag_type in results.columns:
|
||||||
for tag, count in results[tag_type].value_counts().items():
|
for tags, group in results.groupby(tag_type):
|
||||||
result = results[results[tag_type] == tag]
|
if skip_nan and group["profit_abs"].isnull().all():
|
||||||
if skip_nan and result["profit_abs"].isnull().all():
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
tabular_data.append(_generate_result_line(result, starting_balance, tag))
|
tabular_data.append(_generate_result_line(group, starting_balance, tags))
|
||||||
|
|
||||||
# Sort by total profit %:
|
# Sort by total profit %:
|
||||||
tabular_data = sorted(tabular_data, key=lambda k: k["profit_total_abs"], reverse=True)
|
tabular_data = sorted(tabular_data, key=lambda k: k["profit_total_abs"], reverse=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user