mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
xfunding: log submit failed orders
This commit is contained in:
parent
1383eb0401
commit
d0566e23ec
|
@ -624,7 +624,7 @@ func (s *Strategy) reduceFuturesPosition(ctx context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
createdOrders, err := s.futuresOrderExecutor.SubmitOrders(ctx, types.SubmitOrder{
|
||||
submitOrder := types.SubmitOrder{
|
||||
Symbol: s.Symbol,
|
||||
Side: types.SideTypeBuy,
|
||||
Type: types.OrderTypeLimitMaker,
|
||||
|
@ -632,10 +632,11 @@ func (s *Strategy) reduceFuturesPosition(ctx context.Context) {
|
|||
Price: orderPrice,
|
||||
Market: s.futuresMarket,
|
||||
ReduceOnly: true,
|
||||
})
|
||||
}
|
||||
createdOrders, err := s.futuresOrderExecutor.SubmitOrders(ctx, submitOrder)
|
||||
|
||||
if err != nil {
|
||||
log.WithError(err).Errorf("can not submit order")
|
||||
log.WithError(err).Errorf("can not submit futures order: %+v", submitOrder)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -723,17 +724,18 @@ func (s *Strategy) syncFuturesPosition(ctx context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
createdOrders, err := s.futuresOrderExecutor.SubmitOrders(ctx, types.SubmitOrder{
|
||||
submitOrder := types.SubmitOrder{
|
||||
Symbol: s.Symbol,
|
||||
Side: types.SideTypeSell,
|
||||
Type: types.OrderTypeLimitMaker,
|
||||
Quantity: orderQuantity,
|
||||
Price: orderPrice,
|
||||
Market: s.futuresMarket,
|
||||
})
|
||||
}
|
||||
createdOrders, err := s.futuresOrderExecutor.SubmitOrders(ctx, submitOrder)
|
||||
|
||||
if err != nil {
|
||||
log.WithError(err).Errorf("can not submit order")
|
||||
log.WithError(err).Errorf("can not submit spot order: %+v", submitOrder)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user