diff --git a/pkg/bbgo/environment.go b/pkg/bbgo/environment.go index 91f4575df..1685c4472 100644 --- a/pkg/bbgo/environment.go +++ b/pkg/bbgo/environment.go @@ -6,6 +6,7 @@ import ( "fmt" "image/png" "io/ioutil" + "math/rand" "os" "strings" "sync" @@ -27,6 +28,11 @@ import ( "github.com/c9s/bbgo/pkg/util" ) +func init() { + // randomize pulling + rand.Seed(time.Now().UnixNano()) +} + var LoadedExchangeStrategies = make(map[string]SingleExchangeStrategy) var LoadedCrossExchangeStrategies = make(map[string]CrossExchangeStrategy) diff --git a/pkg/exchange/binance/stream.go b/pkg/exchange/binance/stream.go index 37352428a..77a1d660f 100644 --- a/pkg/exchange/binance/stream.go +++ b/pkg/exchange/binance/stream.go @@ -55,8 +55,6 @@ const writeTimeout = 10 * time.Second const listenKeyKeepAliveInterval = 10 * time.Minute func init() { - // randomize pulling - rand.Seed(time.Now().UnixNano()) debugBinanceDepth, _ = strconv.ParseBool(os.Getenv("DEBUG_BINANCE_DEPTH")) if debugBinanceDepth {