binance: fix time in force setting for limit maker

This commit is contained in:
c9s 2024-08-19 15:37:38 +08:00
parent b7d18e687e
commit 648e10fd7c
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -995,13 +995,15 @@ func (e *Exchange) submitMarginOrder(ctx context.Context, order types.SubmitOrde
}
// could be IOC or FOK
if len(order.TimeInForce) > 0 {
// TODO: check the TimeInForce value
req.TimeInForce(binance.TimeInForceType(order.TimeInForce))
} else {
switch order.Type {
case types.OrderTypeLimit, types.OrderTypeStopLimit:
req.TimeInForce(binance.TimeInForceTypeGTC)
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 {
// TODO: check the TimeInForce value
req.TimeInForce(binance.TimeInForceType(order.TimeInForce))
}
}