From 2508dc18f0251c3d547922fec35b8348dde979ae Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 25 Oct 2024 12:14:37 +0800 Subject: [PATCH] liqmaker: use tradingutil.UniversalCancelAllOrders --- pkg/strategy/liquiditymaker/strategy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/strategy/liquiditymaker/strategy.go b/pkg/strategy/liquiditymaker/strategy.go index f332ddbe6..a3a6b92bf 100644 --- a/pkg/strategy/liquiditymaker/strategy.go +++ b/pkg/strategy/liquiditymaker/strategy.go @@ -131,12 +131,12 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo. return err } - if cancelApi, ok := session.Exchange.(advancedOrderCancelApi); ok { - _, _ = cancelApi.CancelOrdersBySymbol(ctx, s.Symbol) - } - s.liquidityScale = scale + if err := tradingutil.UniversalCancelAllOrders(ctx, session.Exchange, s.Symbol, nil); err != nil { + return err + } + session.UserDataStream.OnStart(func() { s.placeLiquidityOrders(ctx) })