refactor: improve naming to reflect method functionality
This commit is contained in:
@@ -51,7 +51,7 @@ class StrategyResolver(IResolver):
|
||||
strategy: IStrategy = StrategyResolver._load_strategy(
|
||||
strategy_name, config=config, extra_dir=config.get("strategy_path")
|
||||
)
|
||||
strategy.ft_load_params_from_file()
|
||||
strategy.ft_set_special_params_from_file()
|
||||
# Set attributes
|
||||
# Check if we need to override configuration
|
||||
# (Attribute name, default, subkey)
|
||||
|
||||
@@ -51,9 +51,10 @@ class HyperStrategyMixin:
|
||||
for par in self._ft_hyper_params[space].values():
|
||||
yield par.name, par
|
||||
|
||||
def ft_load_params_from_file(self) -> None:
|
||||
def ft_set_special_params_from_file(self) -> None:
|
||||
"""
|
||||
Load Parameters from parameter file
|
||||
Sets special parameters (stoploss, roi, trailing, max_open_trades) from the
|
||||
previously loaded file.
|
||||
Should/must run before config values are loaded in strategy_resolver.
|
||||
"""
|
||||
if self._ft_params_from_file:
|
||||
|
||||
@@ -531,7 +531,7 @@ def test_strategy_interface_versioning(dataframe_1m, default_conf):
|
||||
assert "exit_long" in exitdf
|
||||
|
||||
|
||||
def test_strategy_ft_load_params_from_file(mocker, default_conf):
|
||||
def test_strategy_ft_set_special_params_from_file(mocker, default_conf):
|
||||
default_conf.update({"strategy": "StrategyTestV2"})
|
||||
del default_conf["max_open_trades"]
|
||||
mocker.patch(
|
||||
|
||||
Reference in New Issue
Block a user