mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
Merge pull request #1512 from c9s/c9s/fix-boll-history-kline-push
FIX: [bollmaker] fix bollinger indicator history kline push
This commit is contained in:
commit
cb1133b0e0
|
@ -188,8 +188,9 @@ func (environ *Environment) ConfigureDatabase(ctx context.Context, config *Confi
|
||||||
dbDriver = "mysql"
|
dbDriver = "mysql"
|
||||||
}
|
}
|
||||||
|
|
||||||
if dbDriver == "" {
|
// database is optional
|
||||||
return fmt.Errorf("either env DB_DRIVER or config.Driver is not set")
|
if dbDriver == "" || dbDSN == "" {
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return environ.ConfigureDatabaseDriver(ctx, dbDriver, dbDSN, extraPkgNames...)
|
return environ.ConfigureDatabaseDriver(ctx, dbDriver, dbDSN, extraPkgNames...)
|
||||||
|
|
|
@ -38,7 +38,6 @@ func BOLL(source types.Float64Source, window int, k float64) *BOLLStream {
|
||||||
SMA: sma,
|
SMA: sma,
|
||||||
StdDev: stdDev,
|
StdDev: stdDev,
|
||||||
}
|
}
|
||||||
s.Bind(source, s)
|
|
||||||
|
|
||||||
// on band update
|
// on band update
|
||||||
s.Float64Series.OnUpdate(func(band float64) {
|
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.UpBand.PushAndEmit(mid + band)
|
||||||
s.DownBand.PushAndEmit(mid - band)
|
s.DownBand.PushAndEmit(mid - band)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
s.Bind(source, s)
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user