From f884fcd45c3d2a92cc90eb004d579161f580de9c Mon Sep 17 00:00:00 2001 From: David Chang Date: Sun, 11 Apr 2021 20:07:05 +0800 Subject: [PATCH] fix: add ioc trade type to order type --- pkg/exchange/max/convert.go | 3 +++ pkg/exchange/max/exchange.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/exchange/max/convert.go b/pkg/exchange/max/convert.go index 2a6f9707d..e099126a3 100644 --- a/pkg/exchange/max/convert.go +++ b/pkg/exchange/max/convert.go @@ -150,6 +150,9 @@ func toLocalOrderType(orderType types.OrderType) (max.OrderType, error) { case types.OrderTypeMarket: return max.OrderTypeMarket, nil + + case types.OrderTypeIOCLimit: + return max.OrderTypeIOCLimit, nil } return "", fmt.Errorf("order type %s not supported", orderType) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index c6dd6b6d6..d22f394cc 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -334,7 +334,7 @@ func toMaxSubmitOrder(o types.SubmitOrder) (*maxapi.Order, error) { } switch o.Type { - case types.OrderTypeStopLimit, types.OrderTypeLimit, types.OrderTypeLimitMaker: + case types.OrderTypeStopLimit, types.OrderTypeLimit, types.OrderTypeLimitMaker, types.OrderTypeIOCLimit: priceInString := o.PriceString if len(priceInString) == 0 { if o.Market.Symbol != "" {