Skip to content

Commit b04492a

Browse files
authored
Merge pull request #1085 from c9s/bhwu/grid2/fix-group-id
FIX: [grid2] group id should be bound by MaxInt32
2 parents f064f5f + f805445 commit b04492a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/strategy/grid2/strategy.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,7 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
16421642
}
16431643

16441644
if s.OrderGroupID == 0 {
1645-
s.OrderGroupID = util.FNV32(instanceID)
1645+
s.OrderGroupID = util.FNV32(instanceID) % math.MaxInt32
16461646
}
16471647

16481648
if s.AutoRange != nil {
@@ -1869,4 +1869,4 @@ func roundUpMarketQuantity(market types.Market, v fixedpoint.Value, c string) (f
18691869
}
18701870

18711871
return v.Round(prec, fixedpoint.Up), prec
1872-
}
1872+
}

0 commit comments

Comments
 (0)