diff --git a/pkg/bbgo/environment.go b/pkg/bbgo/environment.go index c1f8fc22d2..4caf86c3d6 100644 --- a/pkg/bbgo/environment.go +++ b/pkg/bbgo/environment.go @@ -188,8 +188,9 @@ func (environ *Environment) ConfigureDatabase(ctx context.Context, config *Confi dbDriver = "mysql" } - if dbDriver == "" { - return fmt.Errorf("either env DB_DRIVER or config.Driver is not set") + // database is optional + if dbDriver == "" || dbDSN == "" { + return nil } return environ.ConfigureDatabaseDriver(ctx, dbDriver, dbDSN, extraPkgNames...) diff --git a/pkg/indicator/v2/boll.go b/pkg/indicator/v2/boll.go index 611f0ea346..260d9f4eb5 100644 --- a/pkg/indicator/v2/boll.go +++ b/pkg/indicator/v2/boll.go @@ -38,7 +38,6 @@ func BOLL(source types.Float64Source, window int, k float64) *BOLLStream { SMA: sma, StdDev: stdDev, } - s.Bind(source, s) // on band update s.Float64Series.OnUpdate(func(band float64) { @@ -46,6 +45,8 @@ func BOLL(source types.Float64Source, window int, k float64) *BOLLStream { s.UpBand.PushAndEmit(mid + band) s.DownBand.PushAndEmit(mid - band) }) + + s.Bind(source, s) return s }