pivotshort: fix min leverage protection

This commit is contained in:
c9s 2022-07-21 13:04:19 +08:00
parent 763ae1f62f
commit 756fcb4807
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -265,7 +265,7 @@ func useQuantityOrBaseBalance(session *bbgo.ExchangeSession, market types.Market
if session.IsolatedMargin {
originLeverage := leverage
leverage = fixedpoint.Max(leverage, fixedpoint.NewFromInt(10))
leverage = fixedpoint.Min(leverage, fixedpoint.NewFromInt(10)) // max leverage is 10
log.Infof("using isolated margin, maxLeverage=10 originalLeverage=%f currentLeverage=%f",
originLeverage.Float64(),
leverage.Float64())