Allow None from custom_stop

This commit is contained in:
Matthias
2023-08-14 16:20:54 +02:00
parent 6e32f172be
commit 3ed682a9c6
4 changed files with 16 additions and 14 deletions
+2 -1
View File
@@ -311,7 +311,8 @@ After:
``` python hl_lines="5 7"
def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,
current_rate: float, current_profit: float, after_fill: bool, **kwargs) -> float:
current_rate: float, current_profit: float, after_fill: bool,
**kwargs) -> Optional[float]:
# once the profit has risen above 10%, keep the stoploss at 7% above the open price
if current_profit > 0.10:
return stoploss_from_open(0.07, current_profit, is_short=trade.is_short)