bbgo_origin/pkg/indicator/v2/klinestream_callbacks.go

18 lines
348 B
Go
Raw Permalink Normal View History

// Code generated by "callbackgen -type KLineStream"; DO NOT EDIT.
2023-07-10 08:54:22 +00:00
package indicatorv2
import (
"github.com/c9s/bbgo/pkg/types"
)
func (s *KLineStream) OnUpdate(cb func(k types.KLine)) {
s.updateCallbacks = append(s.updateCallbacks, cb)
}
func (s *KLineStream) EmitUpdate(k types.KLine) {
for _, cb := range s.updateCallbacks {
cb(k)
}
}