liqmaker: use tradingutil.UniversalCancelAllOrders

This commit is contained in:
c9s 2024-10-25 12:14:37 +08:00
parent c3127f45ce
commit 2508dc18f0
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

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