make sure group id is > 0

This commit is contained in:
chiahung 2023-03-06 16:32:36 +08:00
parent d466a63d22
commit 83d9977a57

View File

@ -480,9 +480,12 @@ func (e *Exchange) SubmitOrder(ctx context.Context, order types.SubmitOrder) (cr
Side(toLocalSideType(o.Side)).
Volume(quantityString).
OrderType(orderType).
ClientOrderID(clientOrderID).
// TODO: make sure MAX API support uint32 group id
GroupID(fmt.Sprintf("%d", o.GroupID))
ClientOrderID(clientOrderID)
if o.GroupID > 0 {
// TODO: MAX API only support 0 ~ 2^31-1 (2147483647)
req.GroupID(strconv.FormatUint(uint64(o.GroupID), 10))
}
switch o.Type {
case types.OrderTypeStopLimit, types.OrderTypeLimit, types.OrderTypeLimitMaker: