qbtrade/pkg/indicator/v2/klinestream_callbacks.go
2024-06-27 22:42:38 +08:00

18 lines
359 B
Go

// Code generated by "callbackgen -type KLineStream"; DO NOT EDIT.
package indicatorv2
import (
"git.qtrade.icu/lychiyu/qbtrade/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)
}
}