Skip to content

Commit

Permalink
xdepthmaker: fix num of order check
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Feb 21, 2025
1 parent b068579 commit 182600d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/strategy/xdepthmaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1129,19 +1129,18 @@ func (s *Strategy) updateQuote(ctx context.Context, maxLayer int) {
s.MakerOrderExecutor.ActiveMakerOrders().Print()
return
}

numOfMakerOrders := s.MakerOrderExecutor.ActiveMakerOrders().NumOfOrders()
if numOfMakerOrders > 0 {
s.logger.Warnf("maker orders are not all canceled")
}
} else {
if err := s.partiallyCancelOrders(ctx, maxLayer); err != nil {
s.logger.WithError(err).Warnf("%s partial order cancel failed", s.Symbol)
return
}
}

numOfMakerOrders := s.MakerOrderExecutor.ActiveMakerOrders().NumOfOrders()
if numOfMakerOrders > 0 {
s.logger.Warnf("maker orders are not all canceled")
return
}

bestBid, bestAsk, hasPrice := s.sourceBook.BestBidAndAsk()
if !hasPrice {
s.logger.Warnf("source book has no price")
Expand Down

0 comments on commit 182600d

Please sign in to comment.