Repository: freqtrade/freqtrade

Issue:
Allow simple loading of "dummy" configuration
A simple method to load a minimal configuration should be added.

This can be handy for some data-analysis tasks in notebooks, where no full configuration is needed or necessary.

Something like `Configuration.get_empty_config()`, which contains the minimum required keys set to default values


Discussion:
Something like below?

https://github.com/freqtrade/freqtrade/blob/4c005e70861ec7e2294f6097420e0ece289af2d1/scripts/download_backtest_data.py#L61-L74
Another idea -- freqtrade should work without config at all. With a configuration, where all the settings are filled (automagically) with their default values...

yes and no ... 
regular running won't work without a config ... however certain operatinos should.
my current case:

The below works just fine - but it'd be easier to use `Configuration.get_empty()`
and then replace the 2 attributes that matter for this (user_data_dir does not for this particular operation ...).
```
strategy = StrategyResolver({'strategy': strategyname,
                            'user_data_dir': Path.cwd(),
                            'strategy_path': location}).strategy
```
> yes and no ...
> regular running won't work without a config ... however certain operatinos should.
> my current case:

I mean dry-run,, indeed. It should.
> ```
> strategy = StrategyResolver({'strategy': strategyname,
>                             'user_data_dir': Path.cwd(),
>                             'strategy_path': location}).strategy
> ```

Why do you need both user_data and strategy_path passed here? After loading of configuration (with args), the strategy_path should already be resolved and filled with proper path (taken from the `--strategy-path` option or `strategy_path` setting, if used, or with <userdir>/strategies otherwise... After a call to `Configuration.load_config()` the strategy_path should have its desired value according to the options and config settings. We could write the `load_config(options: str)` helper function (to be used interactively by users in a python interactive interpreter session, jupyter or whatever you call it) that accept the string with options, splits it as shell does into options and calls the `Configuration.load_config()`. If no options passes, no config specified and no default config found, all settings should be filled with their default values, that should be appropriate to run the rest. Including the strategy_path above -- it should be filled with `<pwd>/user_data/strategies`...
This is a snippet from #2080, which is documentation on how to use certain parts independently.

There is no configuration to load in this context (data-analysis). A empty configuration load would help with this (but it's not there and not absolutely necessary for this snippet to work).
Also, i need both user_data_dir and strategy_path, since we load strategies in the following precedence.

* freqtrade/strategy/
* user_data/strategy
* custom_path
...

So we always check both locations, strategy-path is an additional searchpath, not the only one.

However let's not mix things - this is a sample with strategy, but there's more usecases like this once i get to document the independent usage of the plotting functions.
Actually I'm not against that `get_empty_config()`. It can be used in the download script as well and in other 'simple' subcommands that do not require full config. I just think this function/method will not be needed in the future, in the perspective... Let's create/add it, we always will be able to declare it redundant when/if it will be of no real use. Or, on the contrary, we may found this really useful...

I have a separate opinion on the search strategy behavior, but this should be discussed in the PR for userdir...

I created this issue so i don't forget - not necessarily because i intend to implement it that soon ... 
Can be closed?
no? i mean - we can use `load_config_files()` now - but that has flaws since not the whole "config" cycle is running ... so some config keys have the wrong type, causing problems in notebooks...
okay. I thought you simply have forgotten to close this issue after merge of corresponding PR...

Resolving patch:
diff --git a/freqtrade/configuration/check_exchange.py b/freqtrade/configuration/check_exchange.py
--- a/freqtrade/configuration/check_exchange.py
+++ b/freqtrade/configuration/check_exchange.py
@@ -21,7 +21,7 @@ def check_exchange(config: Dict[str, Any], check_for_bad: bool = True) -> bool:
              and thus is not known for the Freqtrade at all.
     """
 
-    if (config['runmode'] in [RunMode.PLOT, RunMode.UTIL_NO_EXCHANGE]
+    if (config['runmode'] in [RunMode.PLOT, RunMode.UTIL_NO_EXCHANGE, RunMode.OTHER]
        and not config.get('exchange', {}).get('name')):
         # Skip checking exchange in plot mode, since it requires no exchange
         return True


Test patch:
diff --git a/tests/test_configuration.py b/tests/test_configuration.py
--- a/tests/test_configuration.py
+++ b/tests/test_configuration.py
@@ -545,7 +545,7 @@ def test_check_exchange(default_conf, caplog) -> None:
 
     # Test no exchange...
     default_conf.get('exchange').update({'name': ''})
-    default_conf['runmode'] = RunMode.OTHER
+    default_conf['runmode'] = RunMode.UTIL_EXCHANGE
     with pytest.raises(OperationalException,
                        match=r'This command requires a configured exchange.*'):
         check_exchange(default_conf)