mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
pivotshort: fix quantity check
This commit is contained in:
parent
9302474d51
commit
f72cf9bfff
|
@ -281,9 +281,11 @@ func useQuantityOrBaseBalance(session *bbgo.ExchangeSession, market types.Market
|
|||
if hasBalance {
|
||||
if quantity.IsZero() {
|
||||
log.Warnf("sell quantity is not set, submitting sell with all base balance: %s", balance.Available.String())
|
||||
quantity = balance.Available
|
||||
if !balance.Available.IsZero() {
|
||||
return balance.Available, nil
|
||||
}
|
||||
} else {
|
||||
quantity = fixedpoint.Min(quantity, balance.Available)
|
||||
return fixedpoint.Min(quantity, balance.Available), nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user