2021-05-08 16:56:44 +00:00
|
|
|
// Code generated by "callbackgen -type MACD"; DO NOT EDIT.
|
|
|
|
|
|
|
|
package indicator
|
|
|
|
|
|
|
|
import ()
|
|
|
|
|
2022-09-15 09:53:12 +00:00
|
|
|
func (inc *MACD) OnUpdate(cb func(macd float64, signal float64, histogram float64)) {
|
2022-07-13 17:16:39 +00:00
|
|
|
inc.updateCallbacks = append(inc.updateCallbacks, cb)
|
2021-05-08 16:56:44 +00:00
|
|
|
}
|
|
|
|
|
2022-09-15 09:53:12 +00:00
|
|
|
func (inc *MACD) EmitUpdate(macd float64, signal float64, histogram float64) {
|
2022-07-13 17:16:39 +00:00
|
|
|
for _, cb := range inc.updateCallbacks {
|
2022-09-15 09:53:12 +00:00
|
|
|
cb(macd, signal, histogram)
|
2021-05-08 16:56:44 +00:00
|
|
|
}
|
|
|
|
}
|