mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
docs: use helper function stoploss_from_absolute
in strategy callbacks "absolute" example
This commit is contained in:
parent
ea566c6eb7
commit
6f401a9e15
|
@ -352,7 +352,7 @@ class AwesomeStrategy(IStrategy):
|
|||
|
||||
# Convert absolute price to percentage relative to current_rate
|
||||
if stoploss_price < current_rate:
|
||||
return (stoploss_price / current_rate) - 1
|
||||
return stoploss_from_absolute(stoploss_price, current_rate, is_short=trade.is_short))
|
||||
|
||||
# return maximum stoploss value, keeping current stoploss price unchanged
|
||||
return 1
|
||||
|
|
Loading…
Reference in New Issue
Block a user