diff --git a/pkg/bbgo/environment.go b/pkg/bbgo/environment.go index b2fb4c9ab..ef4848c47 100644 --- a/pkg/bbgo/environment.go +++ b/pkg/bbgo/environment.go @@ -519,9 +519,11 @@ func (environ *Environment) Connect(ctx context.Context) error { return err } - logger.Infof("connecting %s user data stream...", session.Name) - if err := session.UserDataStream.Connect(ctx); err != nil { - return err + if !session.PublicOnly { + logger.Infof("connecting %s user data stream...", session.Name) + if err := session.UserDataStream.Connect(ctx); err != nil { + return err + } } }