Add entry_tag to leverage callback

closes #6929
This commit is contained in:
Matthias
2022-06-05 10:21:06 +02:00
parent 27bea580d4
commit a790bad1e4
7 changed files with 16 additions and 11 deletions

View File

@@ -178,8 +178,8 @@ class StrategyTestV3(IStrategy):
return dataframe
def leverage(self, pair: str, current_time: datetime, current_rate: float,
proposed_leverage: float, max_leverage: float, side: str,
**kwargs) -> float:
proposed_leverage: float, max_leverage: float, entry_tag: Optional[str],
side: str, **kwargs) -> float:
# Return 3.0 in all cases.
# Bot-logic must make sure it's an allowed leverage and eventually adjust accordingly.

View File

@@ -615,6 +615,7 @@ def test_leverage_callback(default_conf, side) -> None:
proposed_leverage=1.0,
max_leverage=5.0,
side=side,
entry_tag=None,
) == 1
default_conf['strategy'] = CURRENT_TEST_STRATEGY
@@ -626,6 +627,7 @@ def test_leverage_callback(default_conf, side) -> None:
proposed_leverage=1.0,
max_leverage=5.0,
side=side,
entry_tag='entry_tag_test',
) == 3