bbgo_origin/pkg/bbgo/bbomonitor_callbacks.go

18 lines
407 B
Go
Raw Normal View History

2024-08-18 05:16:55 +00:00
// Code generated by "callbackgen -type BboMonitor"; DO NOT EDIT.
2024-09-27 09:53:21 +00:00
package bbgo
2024-08-18 05:16:55 +00:00
import (
"github.com/c9s/bbgo/pkg/types"
)
func (m *BboMonitor) OnUpdate(cb func(bid types.PriceVolume, ask types.PriceVolume)) {
m.updateCallbacks = append(m.updateCallbacks, cb)
}
func (m *BboMonitor) EmitUpdate(bid types.PriceVolume, ask types.PriceVolume) {
for _, cb := range m.updateCallbacks {
cb(bid, ask)
}
}