mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
FIX: [grid2] fix quote accumulation
This commit is contained in:
parent
03e25f12d6
commit
85d002eabc
|
@ -1025,7 +1025,7 @@ func (s *Strategy) generateGridOrders(totalQuote, totalBase, lastPrice fixedpoin
|
|||
TimeInForce: types.TimeInForceGTC,
|
||||
Tag: orderTag,
|
||||
})
|
||||
quoteQuantity := quantity.Mul(price)
|
||||
quoteQuantity := quantity.Mul(nextPrice)
|
||||
usedQuote = usedQuote.Add(quoteQuantity)
|
||||
}
|
||||
} else {
|
||||
|
@ -1043,7 +1043,7 @@ func (s *Strategy) generateGridOrders(totalQuote, totalBase, lastPrice fixedpoin
|
|||
quoteQuantity := quantity.Mul(price)
|
||||
|
||||
if usedQuote.Add(quoteQuantity).Compare(totalQuote) > 0 {
|
||||
s.logger.Warnf("used quote %f > total quote %f, this should not happen", usedQuote.Float64(), totalQuote.Float64())
|
||||
s.logger.Warnf("used quote %f > total quote %f, this should not happen", usedQuote.Add(quoteQuantity).Float64(), totalQuote.Float64())
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -1592,4 +1592,4 @@ func (s *Strategy) openOrdersMismatches(ctx context.Context, session *bbgo.Excha
|
|||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user