mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-20 14:00:38 +00:00
Adding drawdown information for hyperopt-list --export-csv command
This commit is contained in:
@@ -388,6 +388,8 @@ class HyperoptTools:
|
||||
"results_metrics.holding_avg",
|
||||
"results_metrics.trade_count_long",
|
||||
"results_metrics.trade_count_short",
|
||||
"results_metrics.max_drawdown_abs",
|
||||
"results_metrics.max_drawdown_account",
|
||||
"loss",
|
||||
"is_initial_point",
|
||||
"is_best",
|
||||
@@ -409,6 +411,8 @@ class HyperoptTools:
|
||||
"Avg duration",
|
||||
"Trade count long",
|
||||
"Trade count short",
|
||||
"Max drawdown",
|
||||
"Max drawdown percent",
|
||||
"Objective",
|
||||
"is_initial_point",
|
||||
"is_best",
|
||||
@@ -432,6 +436,9 @@ class HyperoptTools:
|
||||
trials["Avg profit"] = trials["Avg profit"].apply(
|
||||
lambda x: f"{x * perc_multi:,.2f}%" if not isna(x) else ""
|
||||
)
|
||||
trials["Max drawdown percent"] = trials["Max drawdown percent"].apply(
|
||||
lambda x: f"{x * perc_multi:,.2f}%" if not isna(x) else ""
|
||||
)
|
||||
trials["Objective"] = trials["Objective"].apply(
|
||||
lambda x: f"{x:,.5f}" if x != 100000 else ""
|
||||
)
|
||||
|
||||
@@ -1532,8 +1532,10 @@ def test_hyperopt_list(mocker, capsys, caplog, tmp_path):
|
||||
assert csv_file.is_file()
|
||||
line = csv_file.read_text()
|
||||
assert (
|
||||
'Best,1,2,-1.25%,-1.2222,-0.00125625,,-2.51,"3,930.0 m",0.43662' in line
|
||||
or "Best,1,2,-1.25%,-1.2222,-0.00125625,,-2.51,2 days 17:30:00,2,0,0.43662" in line
|
||||
'Best,1,2,-1.25%,-1.2222,-0.00125625,,-2.51,"3,930.0 m",-0.00125625,23.00%,0.43662' in line
|
||||
or "Best,1,2,-1.25%,-1.2222,-0.00125625,,-2.51,2 days 17:30:00,2,0,-0.00125625,23.00%,"
|
||||
"0.43662"
|
||||
in line
|
||||
)
|
||||
csv_file.unlink()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user