Some small cleanups
This commit is contained in:
parent
d89a7d5235
commit
14758dbe10
@ -57,3 +57,10 @@ def process_temporary_deprecated_settings(config: Dict[str, Any]) -> None:
|
|||||||
'experimental', 'sell_profit_only')
|
'experimental', 'sell_profit_only')
|
||||||
process_deprecated_setting(config, 'ask_strategy', 'ignore_roi_if_buy_signal',
|
process_deprecated_setting(config, 'ask_strategy', 'ignore_roi_if_buy_signal',
|
||||||
'experimental', 'ignore_roi_if_buy_signal')
|
'experimental', 'ignore_roi_if_buy_signal')
|
||||||
|
|
||||||
|
if config.get('pairlist', {}).get('config', {}).get('precision_filter'):
|
||||||
|
logger.warning(
|
||||||
|
"DEPRECATED: "
|
||||||
|
f"Using precision_filter setting is deprecated and has been replaced by"
|
||||||
|
"PrecisionFilter. Please refer to the docs on configuration details")
|
||||||
|
config['pairlist'].update({'filters': {'PrecisionFilter': {}}})
|
||||||
|
@ -15,7 +15,7 @@ class LowPriceFilter(IPairListFilter):
|
|||||||
self._low_price_percent = config['pairlist']['filters']['LowPriceFilter'].get(
|
self._low_price_percent = config['pairlist']['filters']['LowPriceFilter'].get(
|
||||||
'low_price_percent', 0)
|
'low_price_percent', 0)
|
||||||
|
|
||||||
def _validate_precision_filter_lowprice(self, ticker) -> bool:
|
def _validate_ticker_lowprice(self, ticker) -> bool:
|
||||||
"""
|
"""
|
||||||
Check if if one price-step is > than a certain barrier.
|
Check if if one price-step is > than a certain barrier.
|
||||||
:param ticker: ticker dict as returned from ccxt.load_markets()
|
:param ticker: ticker dict as returned from ccxt.load_markets()
|
||||||
@ -42,7 +42,7 @@ class LowPriceFilter(IPairListFilter):
|
|||||||
ticker = [t for t in tickers if t['symbol'] == p][0]
|
ticker = [t for t in tickers if t['symbol'] == p][0]
|
||||||
|
|
||||||
# Filter out assets which would not allow setting a stoploss
|
# Filter out assets which would not allow setting a stoploss
|
||||||
if self._low_price_percent and not self._validate_precision_filter_lowprice(ticker):
|
if self._low_price_percent and not self._validate_ticker_lowprice(ticker):
|
||||||
pairlist.remove(p)
|
pairlist.remove(p)
|
||||||
|
|
||||||
return pairlist
|
return pairlist
|
||||||
|
@ -963,6 +963,16 @@ def test_process_temporary_deprecated_settings(mocker, default_conf, setting, ca
|
|||||||
assert default_conf[setting[0]][setting[1]] == setting[5]
|
assert default_conf[setting[0]][setting[1]] == setting[5]
|
||||||
|
|
||||||
|
|
||||||
|
def test_process_deprecated_setting_precision_filter(mocker, default_conf, caplog):
|
||||||
|
patched_configuration_load_config_file(mocker, default_conf)
|
||||||
|
default_conf.update({'pairlist': {
|
||||||
|
'config': {'precision_filter': True}
|
||||||
|
}})
|
||||||
|
|
||||||
|
process_temporary_deprecated_settings(default_conf)
|
||||||
|
assert log_has_re(r'DEPRECATED.*precision_filter.*', caplog)
|
||||||
|
|
||||||
|
|
||||||
def test_check_conflicting_settings(mocker, default_conf, caplog):
|
def test_check_conflicting_settings(mocker, default_conf, caplog):
|
||||||
patched_configuration_load_config_file(mocker, default_conf)
|
patched_configuration_load_config_file(mocker, default_conf)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user