Calculate stoploss_from_absolute for shorts

This commit is contained in:
Guillermo Rodríguez
2022-01-22 18:01:02 +01:00
parent e04956be0e
commit 40cd478c6d
2 changed files with 15 additions and 4 deletions

View File

@@ -159,6 +159,13 @@ def test_stoploss_from_absolute():
assert stoploss_from_absolute(100, 0) == 1
assert stoploss_from_absolute(0, 100) == 1
assert stoploss_from_absolute(90, 100, True) == 0
assert stoploss_from_absolute(100, 100, True) == 0
assert stoploss_from_absolute(110, 100, True) == -(1 - (110/100))
assert stoploss_from_absolute(100, 0, True) == 1
assert stoploss_from_absolute(0, 100, True) == 0
assert stoploss_from_absolute(100, 1, True) == 1
# TODO-lev: @pytest.mark.parametrize('candle_type', ['mark', ''])
def test_informative_decorator(mocker, default_conf):