grid2: round down before the quantity calculation

This commit is contained in:
c9s 2023-05-22 17:25:00 +08:00
parent a083ec8395
commit 6ae5d2f33a
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -795,8 +795,8 @@ func (s *Strategy) calculateBaseQuoteInvestmentQuantity(quoteInvestment, baseInv
s.Market.MinQuantity)
if baseQuantity.Compare(minBaseQuantity) <= 0 {
numberOfSellOrders = int(math.Floor(baseInvestment.Div(minBaseQuantity).Float64()))
baseQuantity = s.Market.RoundUpQuantityByPrecision(minBaseQuantity)
numberOfSellOrders = int(math.Floor(baseInvestment.Div(baseQuantity).Float64()))
}
s.logger.Infof("grid base investment sell orders: %d", numberOfSellOrders)