From 7e214d8e4c14fb640a1b4c417c78b07381aaa4b7 Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Sat, 28 Sep 2019 11:50:15 +0300 Subject: [PATCH 01/11] minor: change default stoploss space --- docs/hyperopt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 9542d5725..b31e515ab 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -425,7 +425,7 @@ Buy hyperspace params: Stoploss: -0.37996664668703606 ``` -If you are optimizing stoploss values, Freqtrade creates the 'stoploss' optimization hyperspace for you. By default, the stoploss values in that hyperspace can vary in the range -0.5...-0.02, which is sufficient in most cases. +If you are optimizing stoploss values, Freqtrade creates the 'stoploss' optimization hyperspace for you. By default, the stoploss values in that hyperspace can vary in the range -0.35...-0.02, which is sufficient in most cases. If you have the `stoploss_space()` method in your custom hyperopt file, remove it in order to utilize Stoploss hyperoptimization space generated by Freqtrade by default. From 45f5394d799190edf023bbe493bc3964cd0aebb2 Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Sat, 28 Sep 2019 11:54:26 +0300 Subject: [PATCH 02/11] Align example in the docs --- docs/hyperopt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hyperopt.md b/docs/hyperopt.md index b31e515ab..45528edab 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -422,7 +422,7 @@ Buy hyperspace params: 'adx-enabled': False, 'rsi-enabled': True, 'trigger': 'bb_lower'} -Stoploss: -0.37996664668703606 +Stoploss: -0.27996 ``` If you are optimizing stoploss values, Freqtrade creates the 'stoploss' optimization hyperspace for you. By default, the stoploss values in that hyperspace can vary in the range -0.35...-0.02, which is sufficient in most cases. From 2f005d6be96dcc8d98abcca813a9c10eb5a99eb9 Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Sat, 28 Sep 2019 11:56:19 +0300 Subject: [PATCH 03/11] Align example of ROI in the docs --- docs/hyperopt.md | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 45528edab..beef414bf 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -375,23 +375,12 @@ Buy hyperspace params: 'rsi-enabled': True, 'trigger': 'bb_lower'} ROI table: -{ 0: 0.10674752302642071, - 21: 0.09158372701087236, - 78: 0.03634636907306948, +{ 0: 0.10674, + 21: 0.09158, + 78: 0.03634, 118: 0} ``` -This would translate to the following ROI table: - -``` python -minimal_roi = { - "118": 0, - "78": 0.0363, - "21": 0.0915, - "0": 0.106 - } -``` - If you are optimizing ROI, Freqtrade creates the 'roi' optimization hyperspace for you -- it's the hyperspace of components for the ROI tables. By default, each ROI table generated by the Freqtrade consists of 4 rows (steps). Hyperopt implements adaptive ranges for ROI tables with ranges for values in the ROI steps that depend on the ticker_interval used. By default the values can vary in the following ranges (for some of the most used ticker intervals, values are rounded to 5 digits after the decimal point): | # step | 1m | | 5m | | 1h | | 1d | | From 6a397f579e449e40c18584d45ee318b1603ac7b5 Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Sun, 29 Sep 2019 00:43:27 +0300 Subject: [PATCH 04/11] Add description of usage --- docs/hyperopt.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/hyperopt.md b/docs/hyperopt.md index beef414bf..1ca371e3d 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -381,6 +381,22 @@ ROI table: 118: 0} ``` +In order to use this best ROI table found by Hyperopt in backtesting and for live trades/dry-run, copy-paste it as the value of the `minimal_roi` attribute of your custom strategy: + +``` + # Minimal ROI designed for the strategy. + # This attribute will be overridden if the config file contains "minimal_roi" + minimal_roi = { + 0: 0.10674, + 21: 0.09158, + 78: 0.03634, + 118: 0 + } +``` +As stated in the comment, you can also use it as the value of the `minimal_roi` setting in the configuration file. + +#### Default ROI Search Space + If you are optimizing ROI, Freqtrade creates the 'roi' optimization hyperspace for you -- it's the hyperspace of components for the ROI tables. By default, each ROI table generated by the Freqtrade consists of 4 rows (steps). Hyperopt implements adaptive ranges for ROI tables with ranges for values in the ROI steps that depend on the ticker_interval used. By default the values can vary in the following ranges (for some of the most used ticker intervals, values are rounded to 5 digits after the decimal point): | # step | 1m | | 5m | | 1h | | 1d | | @@ -414,6 +430,17 @@ Buy hyperspace params: Stoploss: -0.27996 ``` +In order to use this best stoploss value found by Hyperopt in backtesting and for live trades/dry-run, copy-paste it as the value of the `stoploss` attribute of your custom strategy: + +``` + # Optimal stoploss designed for the strategy + # This attribute will be overridden if the config file contains "stoploss" + stoploss = -0.27996 +``` +As stated in the comment, you can also use it as the value of the `stoploss` setting in the configuration file. + +#### Default Stoploss Search Space + If you are optimizing stoploss values, Freqtrade creates the 'stoploss' optimization hyperspace for you. By default, the stoploss values in that hyperspace can vary in the range -0.35...-0.02, which is sufficient in most cases. If you have the `stoploss_space()` method in your custom hyperopt file, remove it in order to utilize Stoploss hyperoptimization space generated by Freqtrade by default. From 23665c7731846741070a958c16bd8f27501e4ecc Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 29 Sep 2019 10:25:47 +0200 Subject: [PATCH 05/11] Don't use main.py as entry point in documentation --- docs/installation.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 081d7e0cf..68348d4b0 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -257,14 +257,12 @@ As compiling from source on windows has heavy dependencies (requires a partial v ```cmd >cd \path\freqtrade-develop >python -m venv .env ->cd .env\Scripts ->activate.bat ->cd \path\freqtrade-develop +>.env\Scripts\activate.bat REM optionally install ta-lib from wheel REM >pip install TA_Lib‑0.4.17‑cp36‑cp36m‑win32.whl >pip install -r requirements.txt >pip install -e . ->python freqtrade\main.py +>freqtrade ``` > Thanks [Owdr](https://github.com/Owdr) for the commands. Source: [Issue #222](https://github.com/freqtrade/freqtrade/issues/222) From 03b5be91f7e26ee961a0206694eff5b940601e1e Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 30 Sep 2019 07:28:49 +0200 Subject: [PATCH 06/11] some commands should not have config at all --- freqtrade/configuration/arguments.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/freqtrade/configuration/arguments.py b/freqtrade/configuration/arguments.py index 6e2ecea2e..89c86bdca 100644 --- a/freqtrade/configuration/arguments.py +++ b/freqtrade/configuration/arguments.py @@ -41,7 +41,9 @@ ARGS_PLOT_DATAFRAME = ["pairs", "indicators1", "indicators2", "plot_limit", "db_ ARGS_PLOT_PROFIT = ["pairs", "timerange", "export", "exportfilename", "db_url", "trade_source", "ticker_interval"] -NO_CONF_REQURIED = ["create-userdir", "download-data", "plot-dataframe", "plot-profit"] +NO_CONF_REQURIED = ["download-data", "plot-dataframe", "plot-profit"] + +NO_CONF_ALLOWED = ["create-userdir", "list-exchanges"] class Arguments: @@ -75,12 +77,15 @@ class Arguments: parsed_arg = self.parser.parse_args(self.args) # When no config is provided, but a config exists, use that configuration! + subparser = parsed_arg.subparser if 'subparser' in parsed_arg else None # Workaround issue in argparse with action='append' and default value # (see https://bugs.python.org/issue16399) # Allow no-config for certain commands (like downloading / plotting) - if (parsed_arg.config is None and ((Path.cwd() / constants.DEFAULT_CONFIG).is_file() or - not ('subparser' in parsed_arg and parsed_arg.subparser in NO_CONF_REQURIED))): + if (parsed_arg.config is None + and subparser not in NO_CONF_ALLOWED + and ((Path.cwd() / constants.DEFAULT_CONFIG).is_file() + or (subparser not in NO_CONF_REQURIED))): parsed_arg.config = [constants.DEFAULT_CONFIG] return parsed_arg From 739901b606a3793a01a4dcc4c6801b3b7ac0fbb2 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 30 Sep 2019 09:48:00 +0200 Subject: [PATCH 07/11] Add test for this behaviour --- tests/test_arguments.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/test_arguments.py b/tests/test_arguments.py index cf0104c01..e874e6769 100644 --- a/tests/test_arguments.py +++ b/tests/test_arguments.py @@ -1,5 +1,7 @@ # pragma pylint: disable=missing-docstring, C0103 import argparse +from pathlib import Path +from unittest.mock import MagicMock import pytest @@ -177,6 +179,44 @@ def test_plot_profit_options() -> None: assert pargs["db_url"] == "sqlite:///whatever.sqlite" +def test_config_notallowed(mocker) -> None: + mocker.patch.object(Path, "is_file", MagicMock(return_value=False)) + args = [ + 'create-userdir', + ] + pargs = Arguments(args).get_parsed_arg() + + assert pargs["config"] is None + + # When file exists: + mocker.patch.object(Path, "is_file", MagicMock(return_value=True)) + args = [ + 'create-userdir', + ] + pargs = Arguments(args).get_parsed_arg() + # config is not added even if it exists, since create-userdir is in the notallowed list + assert pargs["config"] is None + + +def test_config_notrequired(mocker) -> None: + mocker.patch.object(Path, "is_file", MagicMock(return_value=False)) + args = [ + 'download-data', + ] + pargs = Arguments(args).get_parsed_arg() + + assert pargs["config"] is None + + # When file exists: + mocker.patch.object(Path, "is_file", MagicMock(return_value=True)) + args = [ + 'download-data', + ] + pargs = Arguments(args).get_parsed_arg() + # config is added if it exists + assert pargs["config"] == ['config.json'] + + def test_check_int_positive() -> None: assert check_int_positive("3") == 3 assert check_int_positive("1") == 1 From 8ae4018e4dab9a5163804fcdcd9eea99994b4e32 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2019 10:19:37 +0000 Subject: [PATCH 08/11] Bump urllib3 from 1.25.5 to 1.25.6 Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.25.5 to 1.25.6. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/master/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.25.5...1.25.6) Signed-off-by: dependabot-preview[bot] --- requirements-common.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-common.txt b/requirements-common.txt index f10134203..6ed4d3139 100644 --- a/requirements-common.txt +++ b/requirements-common.txt @@ -6,7 +6,7 @@ python-telegram-bot==12.1.1 arrow==0.15.2 cachetools==3.1.1 requests==2.22.0 -urllib3==1.25.5 +urllib3==1.25.6 wrapt==1.11.2 jsonschema==3.0.2 TA-Lib==0.4.17 From 9a83d841095bd6223ccc3ff0521fd084ef45b340 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2019 10:20:05 +0000 Subject: [PATCH 09/11] Bump tabulate from 0.8.3 to 0.8.5 Bumps [tabulate](https://github.com/astanin/python-tabulate) from 0.8.3 to 0.8.5. - [Release notes](https://github.com/astanin/python-tabulate/releases) - [Changelog](https://github.com/astanin/python-tabulate/blob/master/CHANGELOG) - [Commits](https://github.com/astanin/python-tabulate/commits/v0.8.5) Signed-off-by: dependabot-preview[bot] --- requirements-common.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-common.txt b/requirements-common.txt index f10134203..e0c594194 100644 --- a/requirements-common.txt +++ b/requirements-common.txt @@ -10,7 +10,7 @@ urllib3==1.25.5 wrapt==1.11.2 jsonschema==3.0.2 TA-Lib==0.4.17 -tabulate==0.8.3 +tabulate==0.8.5 coinmarketcap==5.0.3 # find first, C search in arrays From 3c91ba134f0fd3ad13609927f510b3e520baccda Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2019 10:20:47 +0000 Subject: [PATCH 10/11] Bump pytest-mock from 1.10.4 to 1.11.0 Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.10.4 to 1.11.0. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/1.10.4...v1.11.0) Signed-off-by: dependabot-preview[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index dcf2c7217..755dff4b4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,5 +11,5 @@ mypy==0.720 pytest==5.1.3 pytest-asyncio==0.10.0 pytest-cov==2.7.1 -pytest-mock==1.10.4 +pytest-mock==1.11.0 pytest-random-order==1.0.4 From d74ca78bd8d0bb133e45e82433f628960ddc4403 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2019 10:21:37 +0000 Subject: [PATCH 11/11] Bump ccxt from 1.18.1180 to 1.18.1208 Bumps [ccxt](https://github.com/ccxt/ccxt) from 1.18.1180 to 1.18.1208. - [Release notes](https://github.com/ccxt/ccxt/releases) - [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md) - [Commits](https://github.com/ccxt/ccxt/compare/1.18.1180...1.18.1208) Signed-off-by: dependabot-preview[bot] --- requirements-common.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-common.txt b/requirements-common.txt index f10134203..e74e3a7a7 100644 --- a/requirements-common.txt +++ b/requirements-common.txt @@ -1,6 +1,6 @@ # requirements without requirements installable via conda # mainly used for Raspberry pi installs -ccxt==1.18.1180 +ccxt==1.18.1208 SQLAlchemy==1.3.8 python-telegram-bot==12.1.1 arrow==0.15.2