Add checks verifying that stoploss is not 0 (and positive-stoploss is
also not 0).
This commit is contained in:
@@ -649,8 +649,8 @@ def test_create_userdata_dir_exists_exception(mocker, default_conf, caplog) -> N
|
||||
|
||||
def test_validate_tsl(default_conf):
|
||||
default_conf['stoploss'] = 0.0
|
||||
with pytest.raises(OperationalException, match='The config stoploss needs to be more '
|
||||
'than 0 to avoid problems with sell orders.'):
|
||||
with pytest.raises(OperationalException, match='The config stoploss needs to be different '
|
||||
'from 0 to avoid problems with sell orders.'):
|
||||
validate_config_consistency(default_conf)
|
||||
default_conf['stoploss'] = -0.10
|
||||
|
||||
@@ -680,7 +680,7 @@ def test_validate_tsl(default_conf):
|
||||
default_conf['trailing_stop_positive_offset'] = 0.02
|
||||
default_conf['trailing_only_offset_is_reached'] = False
|
||||
with pytest.raises(OperationalException,
|
||||
match='The config trailing_stop_positive needs to be more than 0'
|
||||
match='The config trailing_stop_positive needs to be different from 0 '
|
||||
'to avoid problems with sell orders'):
|
||||
validate_config_consistency(default_conf)
|
||||
|
||||
|
Reference in New Issue
Block a user