From 7a6000a3163fb25cc0e4f2054b0bae62ab810042 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 8 Jun 2023 18:05:58 +0800 Subject: [PATCH] xalign: fix instanceID --- pkg/strategy/xalign/strategy.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/strategy/xalign/strategy.go b/pkg/strategy/xalign/strategy.go index 11511dd98..5c4457203 100644 --- a/pkg/strategy/xalign/strategy.go +++ b/pkg/strategy/xalign/strategy.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "strings" "time" log "github.com/sirupsen/logrus" @@ -40,7 +41,13 @@ func (s *Strategy) ID() string { } func (s *Strategy) InstanceID() string { - return fmt.Sprintf("%s", ID) + var cs []string + + for cur := range s.ExpectedBalances { + cs = append(cs, cur) + } + + return ID + strings.Join(s.PreferredSessions, "-") + strings.Join(cs, "-") } func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) {