Merge pull request #199 from aitjcize/main

binance: set TimeInForce to GTC by default
This commit is contained in:
Yo-An Lin 2021-04-14 14:06:03 +08:00 committed by GitHub
commit 9ede3feae6

View File

@ -538,6 +538,11 @@ func (e *Exchange) submitMarginOrder(ctx context.Context, order types.SubmitOrde
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)
}
} }
response, err := req.Do(ctx) response, err := req.Do(ctx)
@ -614,6 +619,11 @@ func (e *Exchange) submitSpotOrder(ctx context.Context, order types.SubmitOrder)
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)
}
} }
response, err := req.Do(ctx) response, err := req.Do(ctx)