mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-30 07:26:46 +00:00
binance_cfutures: TimeOnForce is an optional order submission field (#867)
Do not add it to the request unless filled out as the API will deny the request otherwise.
This commit is contained in:
@@ -956,10 +956,15 @@ func (b *Binance) SubmitOrder(ctx context.Context, s *order.Submit) (order.Submi
|
||||
return submitOrderResponse, fmt.Errorf("invalid side")
|
||||
}
|
||||
|
||||
var oType string
|
||||
var (
|
||||
oType string
|
||||
timeInForce RequestParamsTimeForceType
|
||||
)
|
||||
|
||||
switch s.Type {
|
||||
case order.Limit:
|
||||
oType = cfuturesLimit
|
||||
timeInForce = BinanceRequestParamsTimeGTC
|
||||
case order.Market:
|
||||
oType = cfuturesMarket
|
||||
case order.Stop:
|
||||
@@ -975,13 +980,14 @@ func (b *Binance) SubmitOrder(ctx context.Context, s *order.Submit) (order.Submi
|
||||
default:
|
||||
return submitOrderResponse, errors.New("invalid type, check api docs for updates")
|
||||
}
|
||||
|
||||
o, err := b.FuturesNewOrder(
|
||||
ctx,
|
||||
&FuturesNewOrderRequest{
|
||||
Symbol: s.Pair,
|
||||
Side: reqSide,
|
||||
OrderType: oType,
|
||||
TimeInForce: "GTC",
|
||||
TimeInForce: timeInForce,
|
||||
NewClientOrderID: s.ClientOrderID,
|
||||
Quantity: s.Amount,
|
||||
Price: s.Price,
|
||||
|
||||
Reference in New Issue
Block a user