mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1115 from c9s/bhwu/fix-correct-price-metrics
FIX: [grid2] fix correct price metrics
This commit is contained in:
commit
4ac5a2a9e9
|
@ -1124,7 +1124,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