2022-06-05 22:00:43 +00:00
|
|
|
// Code generated by "callbackgen -type ActiveOrderBook"; DO NOT EDIT.
|
|
|
|
|
|
|
|
package bbgo
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
|
|
)
|
|
|
|
|
2023-01-10 12:15:51 +00:00
|
|
|
func (b *ActiveOrderBook) OnNew(cb func(o types.Order)) {
|
|
|
|
b.newCallbacks = append(b.newCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *ActiveOrderBook) EmitNew(o types.Order) {
|
|
|
|
for _, cb := range b.newCallbacks {
|
|
|
|
cb(o)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-05 22:00:43 +00:00
|
|
|
func (b *ActiveOrderBook) OnFilled(cb func(o types.Order)) {
|
|
|
|
b.filledCallbacks = append(b.filledCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *ActiveOrderBook) EmitFilled(o types.Order) {
|
|
|
|
for _, cb := range b.filledCallbacks {
|
|
|
|
cb(o)
|
|
|
|
}
|
|
|
|
}
|
2022-12-04 03:39:43 +00:00
|
|
|
|
|
|
|
func (b *ActiveOrderBook) OnCanceled(cb func(o types.Order)) {
|
|
|
|
b.canceledCallbacks = append(b.canceledCallbacks, cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *ActiveOrderBook) EmitCanceled(o types.Order) {
|
|
|
|
for _, cb := range b.canceledCallbacks {
|
|
|
|
cb(o)
|
|
|
|
}
|
|
|
|
}
|