mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +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
|
"exchange", // exchange name
|
||||||
"symbol", // symbol of the market
|
"symbol", // symbol of the market
|
||||||
"ith",
|
"ith",
|
||||||
|
"side",
|
||||||
}, extendedLabels...),
|
}, extendedLabels...),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -884,6 +884,7 @@ func (s *Strategy) updateOpenOrderPricesMetrics(orders []types.Order) {
|
||||||
metricsGridOrderPrices.Reset()
|
metricsGridOrderPrices.Reset()
|
||||||
for idx, order := range orders {
|
for idx, order := range orders {
|
||||||
labels := s.newPrometheusLabels()
|
labels := s.newPrometheusLabels()
|
||||||
|
labels["side"] = order.Side.String()
|
||||||
labels["ith"] = strconv.Itoa(num - idx)
|
labels["ith"] = strconv.Itoa(num - idx)
|
||||||
metricsGridOrderPrices.With(labels).Set(order.Price.Float64())
|
metricsGridOrderPrices.With(labels).Set(order.Price.Float64())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user