mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
pivotshort: fix min leverage protection
This commit is contained in:
parent
763ae1f62f
commit
756fcb4807
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue
Block a user