diff --git a/pkg/indicator/low.go b/pkg/indicator/low.go deleted file mode 100644 index 6f6d9468b..000000000 --- a/pkg/indicator/low.go +++ /dev/null @@ -1,37 +0,0 @@ -package indicator - -import ( - "time" - - "github.com/c9s/bbgo/pkg/datatype/floats" - "github.com/c9s/bbgo/pkg/types" -) - -//go:generate callbackgen -type Low -type Low struct { - types.IntervalWindow - types.SeriesBase - - Values floats.Slice - EndTime time.Time - - updateCallbacks []func(value float64) -} - -func (inc *Low) Update(value float64) { - if len(inc.Values) == 0 { - inc.SeriesBase.Series = inc - } - - inc.Values.Push(value) -} - -func (inc *Low) PushK(k types.KLine) { - if k.EndTime.Before(inc.EndTime) { - return - } - - inc.Update(k.Low.Float64()) - inc.EndTime = k.EndTime.Time() - inc.EmitUpdate(inc.Last(0)) -} diff --git a/pkg/indicator/low_callbacks.go b/pkg/indicator/low_callbacks.go deleted file mode 100644 index bd261b79a..000000000 --- a/pkg/indicator/low_callbacks.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by "callbackgen -type Low"; DO NOT EDIT. - -package indicator - -import () - -func (inc *Low) OnUpdate(cb func(value float64)) { - inc.updateCallbacks = append(inc.updateCallbacks, cb) -} - -func (inc *Low) EmitUpdate(value float64) { - for _, cb := range inc.updateCallbacks { - cb(value) - } -}