mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: add order side to the metrics label
This commit is contained in:
parent
75919a0bf1
commit
0d47afd5fd
|
@ -52,6 +52,7 @@ func initMetrics(extendedLabels []string) {
|
|||
"exchange", // exchange name
|
||||
"symbol", // symbol of the market
|
||||
"ith",
|
||||
"side",
|
||||
}, extendedLabels...),
|
||||
)
|
||||
|
||||
|
|
|
@ -884,6 +884,7 @@ func (s *Strategy) updateOpenOrderPricesMetrics(orders []types.Order) {
|
|||
metricsGridOrderPrices.Reset()
|
||||
for idx, order := range orders {
|
||||
labels := s.newPrometheusLabels()
|
||||
labels["side"] = order.Side.String()
|
||||
labels["ith"] = strconv.Itoa(num - idx)
|
||||
metricsGridOrderPrices.With(labels).Set(order.Price.Float64())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user