diff --git a/pkg/strategy/dca2/strategy.go b/pkg/strategy/dca2/strategy.go index 85584cdeb..63d16faff 100644 --- a/pkg/strategy/dca2/strategy.go +++ b/pkg/strategy/dca2/strategy.go @@ -186,6 +186,10 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo. s.Position.SetTTL(s.PersistenceTTL.Duration()) s.ProfitStats.SetTTL(s.PersistenceTTL.Duration()) + if s.OrderGroupID == 0 { + s.OrderGroupID = util.FNV32(instanceID) % math.MaxInt32 + } + // round collector s.roundCollector = NewRoundCollector(s.logger, s.Symbol, s.OrderGroupID, s.ExchangeSession.Exchange) if s.roundCollector == nil { @@ -215,10 +219,6 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo. s.OrderExecutor.BindEnvironment(s.Environment) s.OrderExecutor.Bind() - if s.OrderGroupID == 0 { - s.OrderGroupID = util.FNV32(instanceID) % math.MaxInt32 - } - // order executor s.OrderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) { s.logger.Infof("POSITION UPDATE: %s", s.Position.String())