From 690bb7646a35839ce434062800f1841dbd1adaf9 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Sun, 3 May 2020 16:54:42 +0200 Subject: [PATCH 1/8] hyperopt csv export - add params --- freqtrade/optimize/hyperopt.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index 02695d1aa..29d48802c 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -387,12 +387,19 @@ class Hyperopt: trials = json_normalize(results, max_level=1) trials['Best'] = '' trials['Stake currency'] = config['stake_currency'] - trials = trials[['Best', 'current_epoch', 'results_metrics.trade_count', - 'results_metrics.avg_profit', 'results_metrics.total_profit', - 'Stake currency', 'results_metrics.profit', 'results_metrics.duration', - 'loss', 'is_initial_point', 'is_best']] - trials.columns = ['Best', 'Epoch', 'Trades', 'Avg profit', 'Total profit', 'Stake currency', - 'Profit', 'Avg duration', 'Objective', 'is_initial_point', 'is_best'] + + base_metrics = ['Best', 'current_epoch', 'results_metrics.trade_count', + 'results_metrics.avg_profit', 'results_metrics.total_profit', + 'Stake currency', 'results_metrics.profit', 'results_metrics.duration', + 'loss', 'is_initial_point', 'is_best'] + param_metrics = [("params_dict."+param) for param in results[0]['params_dict'].keys()] + trials = trials[base_metrics + param_metrics] + + base_metrics_columns = ['Best', 'Epoch', 'Trades', 'Avg profit', 'Total profit', 'Stake currency', + 'Profit', 'Avg duration', 'Objective', 'is_initial_point', 'is_best'] + param_metrics_columns = list(results[0]['params_dict'].keys()) + trials.columns = base_metrics_columns + param_metrics_columns + trials['is_profit'] = False trials.loc[trials['is_initial_point'], 'Best'] = '*' trials.loc[trials['is_best'], 'Best'] = 'Best' From 889a153731451fa180e845eeb8a8e0b3f481d35d Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Sun, 3 May 2020 17:29:56 +0200 Subject: [PATCH 2/8] fix PEP8 --- freqtrade/optimize/hyperopt.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index 29d48802c..3a28de785 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -388,17 +388,17 @@ class Hyperopt: trials['Best'] = '' trials['Stake currency'] = config['stake_currency'] - base_metrics = ['Best', 'current_epoch', 'results_metrics.trade_count', - 'results_metrics.avg_profit', 'results_metrics.total_profit', - 'Stake currency', 'results_metrics.profit', 'results_metrics.duration', - 'loss', 'is_initial_point', 'is_best'] + base_metrics = ['Best', 'current_epoch', 'results_metrics.trade_count', + 'results_metrics.avg_profit', 'results_metrics.total_profit', + 'Stake currency', 'results_metrics.profit', 'results_metrics.duration', + 'loss', 'is_initial_point', 'is_best'] param_metrics = [("params_dict."+param) for param in results[0]['params_dict'].keys()] trials = trials[base_metrics + param_metrics] - base_metrics_columns = ['Best', 'Epoch', 'Trades', 'Avg profit', 'Total profit', 'Stake currency', - 'Profit', 'Avg duration', 'Objective', 'is_initial_point', 'is_best'] - param_metrics_columns = list(results[0]['params_dict'].keys()) - trials.columns = base_metrics_columns + param_metrics_columns + base_columns = ['Best', 'Epoch', 'Trades', 'Avg profit', 'Total profit', 'Stake currency', + 'Profit', 'Avg duration', 'Objective', 'is_initial_point', 'is_best'] + param_columns = list(results[0]['params_dict'].keys()) + trials.columns = base_columns + param_columns trials['is_profit'] = False trials.loc[trials['is_initial_point'], 'Best'] = '*' From c8f3ef884b13e359c572043b6e9e7892a448cb2d Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Mon, 11 May 2020 20:22:19 +0300 Subject: [PATCH 3/8] Minor: Add filterwarning for DeprecationWarning in test --- tests/optimize/test_backtesting.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/optimize/test_backtesting.py b/tests/optimize/test_backtesting.py index 6c2d6c9dd..093cbf966 100644 --- a/tests/optimize/test_backtesting.py +++ b/tests/optimize/test_backtesting.py @@ -649,6 +649,7 @@ def test_backtest_start_timerange(default_conf, mocker, caplog, testdatadir): assert log_has(line, caplog) +@pytest.mark.filterwarnings("ignore:deprecated") def test_backtest_start_multi_strat(default_conf, mocker, caplog, testdatadir): patch_exchange(mocker) From 258071928f8c673ab18cff5442c9abf5c0026f0e Mon Sep 17 00:00:00 2001 From: prashanthsandela Date: Mon, 11 May 2020 17:21:04 -0700 Subject: [PATCH 4/8] Correct log path in doc. --- docs/docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docker.md b/docs/docker.md index cd24994bc..ad98864a6 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -65,7 +65,7 @@ docker-compose up -d #### Docker-compose logs -Logs will be written to `user_data/freqtrade.log`. +Logs will be written to `user_data/logs/freqtrade.log`. Alternatively, you can check the latest logs using `docker-compose logs -f`. #### Database From aa25461e8854cd7e525b3b7eeddf1bfd8ae3a8d3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 12 May 2020 07:20:59 +0200 Subject: [PATCH 5/8] Show forcebuy status so it's visible before calling forcebuy. --- freqtrade/rpc/rpc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 10eeb572f..851092f1a 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -104,6 +104,7 @@ class RPC: 'ticker_interval': config['ticker_interval'], 'exchange': config['exchange']['name'], 'strategy': config['strategy'], + 'forcebuy_enabled': self._freqtrade.config.get('forcebuy_enable', False), 'state': str(self._freqtrade.state) } return val From e2b9c248568a03b30016a3c13ac72b5f8f51ef91 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Tue, 12 May 2020 13:54:13 +0300 Subject: [PATCH 6/8] Docs: Fix sample in strategy-advanced --- docs/strategy-advanced.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index 39e92d651..684e58f22 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -20,7 +20,7 @@ It applies a tight timeout for higher priced assets, while allowing more time to The function must return either `True` (cancel order) or `False` (keep order alive). ``` python -from datetime import datetime, timestamp +from datetime import datetime from freqtrade.persistence import Trade class Awesomestrategy(IStrategy): @@ -59,7 +59,7 @@ class Awesomestrategy(IStrategy): ### Custom order timeout example (using additional data) ``` python -from datetime import datetime, timestamp +from datetime import datetime from freqtrade.persistence import Trade class Awesomestrategy(IStrategy): From 77c9334c50cc43453b71e5ab4bd9e3353e8f80c0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 12 May 2020 13:39:24 +0200 Subject: [PATCH 7/8] Use available config object Co-authored-by: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> --- freqtrade/rpc/rpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 851092f1a..d3b6b9639 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -104,7 +104,7 @@ class RPC: 'ticker_interval': config['ticker_interval'], 'exchange': config['exchange']['name'], 'strategy': config['strategy'], - 'forcebuy_enabled': self._freqtrade.config.get('forcebuy_enable', False), + 'forcebuy_enabled': config.get('forcebuy_enable', False), 'state': str(self._freqtrade.state) } return val From f1367b38a4c52c605287d876721c9070873eb901 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Tue, 12 May 2020 14:42:33 +0300 Subject: [PATCH 8/8] Docs: Fix the fix --- docs/strategy-advanced.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index 684e58f22..69e2256a1 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -20,7 +20,7 @@ It applies a tight timeout for higher priced assets, while allowing more time to The function must return either `True` (cancel order) or `False` (keep order alive). ``` python -from datetime import datetime +from datetime import datetime, timedelta from freqtrade.persistence import Trade class Awesomestrategy(IStrategy):