mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
grid2: truncate max base quantity
This commit is contained in:
parent
c5e7a78067
commit
86a99b5902
|
@ -785,7 +785,11 @@ func (s *Strategy) calculateBaseQuoteInvestmentQuantity(quoteInvestment, baseInv
|
|||
for maxBaseQuantity.Compare(s.Market.MinQuantity) <= 0 || maxBaseQuantity.Compare(minBaseQuantity) <= 0 {
|
||||
maxNumberOfSellOrders--
|
||||
maxBaseQuantity = baseInvestment.Div(fixedpoint.NewFromInt(int64(maxNumberOfSellOrders)))
|
||||
|
||||
// maxBaseQuantity = s.Market.RoundDownQuantityByPrecision(maxBaseQuantity)
|
||||
maxBaseQuantity = s.Market.TruncateQuantity(maxBaseQuantity)
|
||||
}
|
||||
|
||||
s.logger.Infof("grid base investment sell orders: %d", maxNumberOfSellOrders)
|
||||
if maxNumberOfSellOrders > 0 {
|
||||
s.logger.Infof("grid base investment quantity: %f (base investment) / %d (number of sell orders) = %f (base quantity per order)", baseInvestment.Float64(), maxNumberOfSellOrders, maxBaseQuantity.Float64())
|
||||
|
|
Loading…
Reference in New Issue
Block a user