update timeInForce for binance margin order

This commit is contained in:
Lan Phan 2024-09-03 00:38:17 +07:00 committed by lychiyu
parent ca847047ac
commit af777c335b

View File

@ -1020,16 +1020,13 @@ func (e *Exchange) submitMarginOrder(ctx context.Context, order types.SubmitOrde
} }
} }
// could be IOC or FOK
switch order.Type {
case types.OrderTypeLimit, types.OrderTypeStopLimit:
req.TimeInForce(binance.TimeInForceTypeGTC)
case types.OrderTypeLimitMaker:
// do not set TimeInForce for LimitMaker
default:
if len(order.TimeInForce) > 0 { if len(order.TimeInForce) > 0 {
// TODO: check the TimeInForce value // TODO: check the TimeInForce value
req.TimeInForce(binance.TimeInForceType(order.TimeInForce)) req.TimeInForce(binance.TimeInForceType(order.TimeInForce))
} else {
switch order.Type {
case types.OrderTypeLimit, types.OrderTypeStopLimit:
req.TimeInForce(binance.TimeInForceTypeGTC)
} }
} }