Fix cancel all orders

This commit is contained in:
c9s 2024-05-11 22:47:29 +08:00 committed by GitHub
parent 002151bf1a
commit b752e5ec60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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