fix: don't bracked stoploss to 1
it's problematic for short trades - especially if they move past the 100% profit margin - as price starts to trail.
This commit is contained in:
@@ -182,5 +182,4 @@ def stoploss_from_absolute(
|
|||||||
|
|
||||||
# negative stoploss values indicate the requested stop price is higher/lower
|
# negative stoploss values indicate the requested stop price is higher/lower
|
||||||
# (long/short) than the current price
|
# (long/short) than the current price
|
||||||
# shorts can yield stoploss values higher than 1, so limit that as well
|
return max(stoploss, 0.0) * leverage
|
||||||
return max(min(stoploss, 1.0), 0.0) * leverage
|
|
||||||
|
|||||||
Reference in New Issue
Block a user