mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
28 lines
846 B
Go
28 lines
846 B
Go
// Code generated by "callbackgen -type MarketDataStore"; DO NOT EDIT.
|
|
|
|
package bbgo
|
|
|
|
import (
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
)
|
|
|
|
func (store *MarketDataStore) OnKLineWindowUpdate(cb func(interval types.Interval, kline types.KLineWindow)) {
|
|
store.kLineWindowUpdateCallbacks = append(store.kLineWindowUpdateCallbacks, cb)
|
|
}
|
|
|
|
func (store *MarketDataStore) EmitKLineWindowUpdate(interval types.Interval, kline types.KLineWindow) {
|
|
for _, cb := range store.kLineWindowUpdateCallbacks {
|
|
cb(interval, kline)
|
|
}
|
|
}
|
|
|
|
func (store *MarketDataStore) OnOrderBookUpdate(cb func(orderBook *types.StreamOrderBook)) {
|
|
store.orderBookUpdateCallbacks = append(store.orderBookUpdateCallbacks, cb)
|
|
}
|
|
|
|
func (store *MarketDataStore) EmitOrderBookUpdate(orderBook *types.StreamOrderBook) {
|
|
for _, cb := range store.orderBookUpdateCallbacks {
|
|
cb(orderBook)
|
|
}
|
|
}
|