Require use_sell_signal to be true for edge

Otherwise edge will have strange results, as
edge runs with sell signal, while the bot runs without sell signal,
causing results to be invalid

closes #3900
This commit is contained in:
Matthias 2020-11-24 07:47:35 +01:00
parent 730c9ce471
commit 006436a18d
2 changed files with 19 additions and 0 deletions

View File

@ -137,6 +137,10 @@ def _validate_edge(conf: Dict[str, Any]) -> None:
"Edge and VolumePairList are incompatible, "
"Edge will override whatever pairs VolumePairlist selects."
)
if not conf.get('ask_strategy', {}).get('use_sell_signal', True):
raise OperationalException(
"Edge requires `use_sell_signal` to be True, otherwise no sells will happen."
)
def _validate_whitelist(conf: Dict[str, Any]) -> None:

View File

@ -812,6 +812,21 @@ def test_validate_edge(edge_conf):
validate_config_consistency(edge_conf)
def test_validate_edge2(edge_conf):
edge_conf.update({"ask_strategy": {
"use_sell_signal": True,
}})
# Passes test
validate_config_consistency(edge_conf)
edge_conf.update({"ask_strategy": {
"use_sell_signal": False,
}})
with pytest.raises(OperationalException, match="Edge requires `use_sell_signal` to be True, "
"otherwise no sells will happen."):
validate_config_consistency(edge_conf)
def test_validate_whitelist(default_conf):
default_conf['runmode'] = RunMode.DRY_RUN
# Test regular case - has whitelist and uses StaticPairlist