mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
FIX: [grid2] specify client order id explicitly
This commit is contained in:
parent
31e299baf2
commit
16b30960cc
|
@ -11,6 +11,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -494,6 +495,7 @@ func (s *Strategy) processFilledOrder(o types.Order) {
|
|||
Quantity: newQuantity,
|
||||
Tag: orderTag,
|
||||
GroupID: s.OrderGroupID,
|
||||
ClientOrderID: uuid.New().String(),
|
||||
}
|
||||
|
||||
s.logger.Infof("SUBMIT GRID REVERSE ORDER: %s", orderForm.String())
|
||||
|
@ -1251,6 +1253,7 @@ func (s *Strategy) generateGridOrders(totalQuote, totalBase, lastPrice fixedpoin
|
|||
TimeInForce: types.TimeInForceGTC,
|
||||
Tag: orderTag,
|
||||
GroupID: s.OrderGroupID,
|
||||
ClientOrderID: uuid.New().String(),
|
||||
})
|
||||
usedBase = usedBase.Add(quantity)
|
||||
} else {
|
||||
|
@ -1268,6 +1271,7 @@ func (s *Strategy) generateGridOrders(totalQuote, totalBase, lastPrice fixedpoin
|
|||
TimeInForce: types.TimeInForceGTC,
|
||||
Tag: orderTag,
|
||||
GroupID: s.OrderGroupID,
|
||||
ClientOrderID: uuid.New().String(),
|
||||
})
|
||||
quoteQuantity := quantity.Mul(nextPrice)
|
||||
usedQuote = usedQuote.Add(quoteQuantity)
|
||||
|
@ -1301,6 +1305,7 @@ func (s *Strategy) generateGridOrders(totalQuote, totalBase, lastPrice fixedpoin
|
|||
TimeInForce: types.TimeInForceGTC,
|
||||
Tag: orderTag,
|
||||
GroupID: s.OrderGroupID,
|
||||
ClientOrderID: uuid.New().String(),
|
||||
})
|
||||
usedQuote = usedQuote.Add(quoteQuantity)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user