FIX: [grid2] fix correct price metrics

This commit is contained in:
gx578007 2023-03-15 21:40:44 +08:00
parent 94828e6f55
commit 74c465d943

View File

@ -1122,7 +1122,14 @@ func (s *Strategy) updateGridNumOfOrdersMetrics(grid *Grid) {
metricsGridNumOfMissingOrders.With(baseLabels).Set(float64(numOfMissingOrders))
var numOfOrdersWithCorrectPrice int
priceSet := make(map[fixedpoint.Value]struct{})
for _, order := range makerOrders.Orders() {
// filter out duplicated prices
if _, ok := priceSet[order.Price]; ok {
continue
}
priceSet[order.Price] = struct{}{}
if grid.HasPin(Pin(order.Price)) {
numOfOrdersWithCorrectPrice++
}