indicator: add KLineLoader interface

This commit is contained in:
c9s 2022-07-14 10:31:38 +08:00
parent cb481c660f
commit 77264342ce
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -16,6 +16,12 @@ type KLinePusher interface {
PushK(k types.KLine) 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 { type KLineCalculateUpdater interface {
CalculateAndUpdate(allKLines []types.KLine) CalculateAndUpdate(allKLines []types.KLine)
} }