2020-10-18 12:24:16 +00:00
|
|
|
// Code generated by "callbackgen -type MarketDataStore"; DO NOT EDIT.
|
|
|
|
|
2020-10-28 08:27:25 +00:00
|
|
|
package bbgo
|
2020-10-18 12:24:16 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
|
|
)
|
|
|
|
|
2022-04-08 09:48:33 +00:00
|
|
|
func (store *MarketDataStore) OnKLineWindowUpdate(cb func(interval types.Interval, klines types.KLineWindow)) {
|
2020-10-28 08:27:25 +00:00
|
|
|
store.kLineWindowUpdateCallbacks = append(store.kLineWindowUpdateCallbacks, cb)
|
2020-10-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
2022-04-08 09:48:33 +00:00
|
|
|
func (store *MarketDataStore) EmitKLineWindowUpdate(interval types.Interval, klines types.KLineWindow) {
|
2020-10-28 08:27:25 +00:00
|
|
|
for _, cb := range store.kLineWindowUpdateCallbacks {
|
2022-04-08 09:48:33 +00:00
|
|
|
cb(interval, klines)
|
2020-10-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
}
|