mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Fix cancel all orders
This commit is contained in:
parent
002151bf1a
commit
b752e5ec60
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/c9s/bbgo/pkg/strategy/common"
|
||||
"github.com/c9s/bbgo/pkg/types"
|
||||
"github.com/c9s/bbgo/pkg/util"
|
||||
"github.com/c9s/bbgo/pkg/util/tradingutil"
|
||||
)
|
||||
|
||||
const ID = "liquiditymaker"
|
||||
|
@ -145,6 +146,10 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
|
|||
if err := s.adjustmentOrderBook.GracefulCancel(ctx, s.Session.Exchange); err != nil {
|
||||
util.LogErr(err, "unable to cancel adjustment orders")
|
||||
}
|
||||
|
||||
if err := tradingutil.UniversalCancelAllOrders(ctx, s.Session.Exchange, nil); err != nil {
|
||||
util.LogErr(err, "unable to cancel all orders")
|
||||
}
|
||||
})
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user