mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
convert limit maker type to post only
This commit is contained in:
parent
837934e690
commit
1f744b0fa5
|
@ -311,9 +311,15 @@ func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder
|
|||
|
||||
req := e.client.OrderService.NewCreateOrderRequest().
|
||||
Market(toLocalSymbol(order.Symbol)).
|
||||
OrderType(string(orderType)).
|
||||
Side(toLocalSideType(order.Side))
|
||||
|
||||
// convert limit maker to post_only
|
||||
if order.Type == types.OrderTypeLimitMaker {
|
||||
req.OrderType(string(maxapi.OrderTypePostOnly))
|
||||
} else {
|
||||
req.OrderType(string(orderType))
|
||||
}
|
||||
|
||||
if len(order.ClientOrderID) > 0 {
|
||||
req.ClientOrderID(order.ClientOrderID)
|
||||
} else {
|
||||
|
@ -331,7 +337,7 @@ func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder
|
|||
|
||||
// set price field for limit orders
|
||||
switch order.Type {
|
||||
case types.OrderTypeStopLimit, types.OrderTypeLimit:
|
||||
case types.OrderTypeStopLimit, types.OrderTypeLimit, types.OrderTypeLimitMaker:
|
||||
if len(order.PriceString) > 0 {
|
||||
req.Price(order.PriceString)
|
||||
} else if order.Market.Symbol != "" {
|
||||
|
@ -339,6 +345,7 @@ func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// set stop price field for limit orders
|
||||
switch order.Type {
|
||||
case types.OrderTypeStopLimit, types.OrderTypeStopMarket:
|
||||
|
|
Loading…
Reference in New Issue
Block a user