diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index c8c376a5e..f5412fd27 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -572,11 +572,12 @@ func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value) { bbgo.Notify("Submitting %s hedge order %s %v", s.Symbol, side.String(), quantity) orderExecutor := &bbgo.ExchangeOrderExecutor{Session: s.sourceSession} returnOrders, err := orderExecutor.SubmitOrders(ctx, types.SubmitOrder{ - Market: s.sourceMarket, - Symbol: s.Symbol, - Type: types.OrderTypeMarket, - Side: side, - Quantity: quantity, + Market: s.sourceMarket, + Symbol: s.Symbol, + Type: types.OrderTypeMarket, + Side: side, + Quantity: quantity, + MarginSideEffect: types.SideEffectTypeMarginBuy, }) if err != nil { diff --git a/pkg/types/position.go b/pkg/types/position.go index 52cdc8617..e232cbcbe 100644 --- a/pkg/types/position.go +++ b/pkg/types/position.go @@ -665,6 +665,7 @@ func (p *Position) updateMetrics() { labels := prometheus.Labels{ "strategy_id": p.StrategyInstanceID, "strategy_type": p.Strategy, + "symbol": p.Symbol, } positionAverageCostMetrics.With(labels).Set(p.AverageCost.Float64()) positionBaseQuantityMetrics.With(labels).Set(p.Base.Float64())