increase min amount if it's not greater than min notional

This commit is contained in:
c9s 2021-11-04 23:22:01 +08:00
parent 13577fc2b4
commit bfaec8fdd8

View File

@ -428,8 +428,8 @@ func (s *Strategy) handleFilledOrder(filledOrder types.Order) {
amount = quantity * price
}
if amount < s.Market.MinNotional {
quantity = bbgo.AdjustFloatQuantityByMinAmount(quantity, price, s.Market.MinNotional)
if amount <= s.Market.MinNotional {
quantity = bbgo.AdjustFloatQuantityByMinAmount(quantity, price, s.Market.MinNotional * 1.001)
// update amount
amount = quantity * price
@ -458,7 +458,7 @@ func (s *Strategy) handleFilledOrder(filledOrder types.Order) {
s.activeOrders.Add(createdOrders...)
if err != nil {
log.WithError(err).Errorf("can not place orders")
log.WithError(err).Errorf("can not place orders: %+v", submitOrder)
return
}