mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
28 lines
826 B
Go
28 lines
826 B
Go
package indicator
|
|
|
|
import "github.com/c9s/bbgo/pkg/types"
|
|
|
|
type KLineWindowUpdater interface {
|
|
OnKLineWindowUpdate(func(interval types.Interval, window types.KLineWindow))
|
|
}
|
|
|
|
type KLineClosedEmitter interface {
|
|
OnKLineClosed(func(k types.KLine))
|
|
}
|
|
|
|
// KLinePusher provides an interface for API user to push kline value to the indicator.
|
|
// The indicator implements its own way to calculate the value from the given kline object.
|
|
type KLinePusher interface {
|
|
PushK(k types.KLine)
|
|
}
|
|
|
|
// KLineLoader provides an interface for API user to load history klines to the indicator.
|
|
// The indicator implements its own way to calculate the values from the given history kline array.
|
|
type KLineLoader interface {
|
|
LoadK(allKLines []types.KLine)
|
|
}
|
|
|
|
type KLineCalculateUpdater interface {
|
|
CalculateAndUpdate(allKLines []types.KLine)
|
|
}
|