Skip to content

Commit b820810

Browse files
author
Andras Kovacs
committed
hyperopt-list --export-csv command stake currency fix
Take stake currency from hyperopt result file instead of config
1 parent 0c08656 commit b820810

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

freqtrade/optimize/hyperopt_tools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ def export_csv_file(config: Config, results: list, csv_file: str) -> None:
374374

375375
trials = json_normalize(results, max_level=1)
376376
trials["Best"] = ""
377-
trials["Stake currency"] = config["stake_currency"]
378377

379378
base_metrics = [
380379
"Best",
@@ -383,7 +382,7 @@ def export_csv_file(config: Config, results: list, csv_file: str) -> None:
383382
"results_metrics.profit_mean",
384383
"results_metrics.profit_median",
385384
"results_metrics.profit_total",
386-
"Stake currency",
385+
"results_metrics.stake_currency",
387386
"results_metrics.profit_total_abs",
388387
"results_metrics.holding_avg",
389388
"results_metrics.trade_count_long",

tests/commands/test_commands.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,8 +1532,9 @@ def fake_iterator(*args, **kwargs):
15321532
assert csv_file.is_file()
15331533
line = csv_file.read_text()
15341534
assert (
1535-
'Best,1,2,-1.25%,-1.2222,-0.00125625,,-2.51,"3,930.0 m",-0.00125625,23.00%,0.43662' in line
1536-
or "Best,1,2,-1.25%,-1.2222,-0.00125625,,-2.51,2 days 17:30:00,2,0,-0.00125625,23.00%,"
1535+
'Best,1,2,-1.25%,-1.2222,-0.00125625,BTC,-2.51,"3,930.0 m",-0.00125625,23.00%,0.43662'
1536+
in line
1537+
or "Best,1,2,-1.25%,-1.2222,-0.00125625,BTC,-2.51,2 days 17:30:00,2,0,-0.00125625,23.00%,"
15371538
"0.43662"
15381539
in line
15391540
)

0 commit comments

Comments
 (0)