mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
FIX: [grid2] fix correct price metrics
This commit is contained in:
parent
94828e6f55
commit
74c465d943
|
@ -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++
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user