From 4ec83a2c24f23d0fe852c01d39289bf22c25600f Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Fri, 18 Oct 2019 23:29:19 +0300 Subject: [PATCH] DefaultHyperOpts --> DefaultHyperOpt; hyperopts --> hyperopt where it's not correct --- docs/bot-usage.md | 4 ++-- docs/faq.md | 4 ++-- docs/hyperopt.md | 12 ++++++------ freqtrade/constants.py | 2 +- freqtrade/optimize/default_hyperopt.py | 2 +- freqtrade/resolvers/pairlist_resolver.py | 4 ++-- tests/optimize/test_hyperopt.py | 10 +++++----- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/bot-usage.md b/docs/bot-usage.md index 7da0d029b..a0437976f 100644 --- a/docs/bot-usage.md +++ b/docs/bot-usage.md @@ -106,7 +106,7 @@ user_data/ ├── backtest_results ├── data ├── hyperopts -├── hyperopts_results +├── hyperopt_results ├── plot └── strategies ``` @@ -256,7 +256,7 @@ optional arguments: entry and exit). --customhyperopt NAME Specify hyperopt class name (default: - `DefaultHyperOpts`). + `DefaultHyperOpt`). --hyperopt-path PATH Specify additional lookup path for Hyperopts and Hyperopt Loss functions. --eps, --enable-position-stacking diff --git a/docs/faq.md b/docs/faq.md index a441ffacd..dd92d310e 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -38,7 +38,7 @@ like pauses. You can stop your bot, adjust settings and start it again. ### I want to improve the bot with a new strategy -That's great. We have a nice backtesting and hyperoptimizing setup. See +That's great. We have a nice backtesting and hyperoptimization setup. See the tutorial [here|Testing-new-strategies-with-Hyperopt](bot-usage.md#hyperopt-commands). ### Is there a setting to only SELL the coins being held and not perform anymore BUYS? @@ -59,7 +59,7 @@ If you're a US customer, the bot will fail to create orders for these pairs, and ### How many epoch do I need to get a good Hyperopt result? -Per default Hyperopts without `-e` or `--epochs` parameter will only +Per default Hyperopt called without the `-e`/`--epochs` command line option will only run 100 epochs, means 100 evals of your triggers, guards, ... Too few to find a great result (unless if you are very lucky), so you probably have to run it for 10.000 or more. But it will take an eternity to diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 1ca371e3d..99331707f 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -10,12 +10,12 @@ Hyperopt requires historic data to be available, just as backtesting does. To learn how to get data for the pairs and exchange you're interrested in, head over to the [Data Downloading](data-download.md) section of the documentation. !!! Bug - Hyperopt will crash when used with only 1 CPU Core as found out in [Issue #1133](https://github.com/freqtrade/freqtrade/issues/1133) + Hyperopt can crash when used with only 1 CPU Core as found out in [Issue #1133](https://github.com/freqtrade/freqtrade/issues/1133) ## Prepare Hyperopting Before we start digging into Hyperopt, we recommend you to take a look at -an example hyperopt file located into [user_data/hyperopts/](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/sample_hyperopt.py) +the sample hyperopt file located in [user_data/hyperopts/](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/sample_hyperopt.py). Configuring hyperopt is similar to writing your own strategy, and many tasks will be similar and a lot of code can be copied across from the strategy. @@ -64,9 +64,9 @@ multiple guards. The constructed strategy will be something like "*buy exactly when close price touches lower bollinger band, BUT only if ADX > 10*". -If you have updated the buy strategy, ie. changed the contents of -`populate_buy_trend()` method you have to update the `guards` and -`triggers` hyperopts must use. +If you have updated the buy strategy, i.e. changed the contents of +`populate_buy_trend()` method, you have to update the `guards` and +`triggers` your hyperopt must use correspondingly. #### Sell optimization @@ -82,7 +82,7 @@ To avoid naming collisions in the search-space, please prefix all sell-spaces wi #### Using ticker-interval as part of the Strategy The Strategy exposes the ticker-interval as `self.ticker_interval`. The same value is available as class-attribute `HyperoptName.ticker_interval`. -In the case of the linked sample-value this would be `SampleHyperOpts.ticker_interval`. +In the case of the linked sample-value this would be `SampleHyperOpt.ticker_interval`. ## Solving a Mystery diff --git a/freqtrade/constants.py b/freqtrade/constants.py index a310b4896..e8f3f5783 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -10,7 +10,7 @@ DEFAULT_TICKER_INTERVAL = 5 # min HYPEROPT_EPOCH = 100 # epochs RETRY_TIMEOUT = 30 # sec DEFAULT_STRATEGY = 'DefaultStrategy' -DEFAULT_HYPEROPT = 'DefaultHyperOpts' +DEFAULT_HYPEROPT = 'DefaultHyperOpt' DEFAULT_HYPEROPT_LOSS = 'DefaultHyperOptLoss' DEFAULT_DB_PROD_URL = 'sqlite:///tradesv3.sqlite' DEFAULT_DB_DRYRUN_URL = 'sqlite://' diff --git a/freqtrade/optimize/default_hyperopt.py b/freqtrade/optimize/default_hyperopt.py index 2554982ad..2e2bca3d0 100644 --- a/freqtrade/optimize/default_hyperopt.py +++ b/freqtrade/optimize/default_hyperopt.py @@ -11,7 +11,7 @@ import freqtrade.vendor.qtpylib.indicators as qtpylib from freqtrade.optimize.hyperopt_interface import IHyperOpt -class DefaultHyperOpts(IHyperOpt): +class DefaultHyperOpt(IHyperOpt): """ Default hyperopt provided by the Freqtrade bot. You can override it with your own Hyperopt diff --git a/freqtrade/resolvers/pairlist_resolver.py b/freqtrade/resolvers/pairlist_resolver.py index 2ddf5de2f..c2782a219 100644 --- a/freqtrade/resolvers/pairlist_resolver.py +++ b/freqtrade/resolvers/pairlist_resolver.py @@ -1,7 +1,7 @@ # pragma pylint: disable=attribute-defined-outside-init """ -This module load custom hyperopts +This module load custom pairlists """ import logging from pathlib import Path @@ -15,7 +15,7 @@ logger = logging.getLogger(__name__) class PairListResolver(IResolver): """ - This class contains all the logic to load custom hyperopt class + This class contains all the logic to load custom PairList class """ __slots__ = ['pairlist'] diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index c9a112422..052c3ba77 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -12,7 +12,7 @@ from freqtrade import OperationalException from freqtrade.data.converter import parse_ticker_dataframe from freqtrade.data.history import load_tickerdata_file from freqtrade.optimize import setup_configuration, start_hyperopt -from freqtrade.optimize.default_hyperopt import DefaultHyperOpts +from freqtrade.optimize.default_hyperopt import DefaultHyperOpt from freqtrade.optimize.default_hyperopt_loss import DefaultHyperOptLoss from freqtrade.optimize.hyperopt import Hyperopt from freqtrade.resolvers.hyperopt_resolver import (HyperOptLossResolver, @@ -148,12 +148,12 @@ def test_setup_hyperopt_configuration_with_arguments(mocker, default_conf, caplo def test_hyperoptresolver(mocker, default_conf, caplog) -> None: patched_configuration_load_config_file(mocker, default_conf) - hyperopts = DefaultHyperOpts - delattr(hyperopts, 'populate_buy_trend') - delattr(hyperopts, 'populate_sell_trend') + hyperopt = DefaultHyperOpt + delattr(hyperopt, 'populate_buy_trend') + delattr(hyperopt, 'populate_sell_trend') mocker.patch( 'freqtrade.resolvers.hyperopt_resolver.HyperOptResolver._load_hyperopt', - MagicMock(return_value=hyperopts(default_conf)) + MagicMock(return_value=hyperopt(default_conf)) ) x = HyperOptResolver(default_conf, ).hyperopt assert not hasattr(x, 'populate_buy_trend')