You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
653 B
23 lines
653 B
package strategy |
|
|
|
import ( |
|
"sig-pub/api/pb" |
|
"sig-pub/pkg/indicator" |
|
"sig-pub/pkg/types" |
|
"sig-pub/pkg/types/series" |
|
) |
|
|
|
// 多周期k线策略接口 |
|
type IIntervalSigStrategy interface { |
|
UpdateByInterval(ctx IIntervalStrategyContext) (side pb.Side) |
|
} |
|
|
|
// IIntervalStrategyContext 多周期策略上下文 |
|
type IIntervalStrategyContext interface { |
|
// Get [0]当前k线 |
|
Get(interval types.Interval, offset int16) types.Kline |
|
// Series [offset...end] |
|
Series(interval types.Interval, offset, count int16) (klines series.Klines) |
|
// 获取窗口类型指标 |
|
IndicatorW(interval types.Interval, name string, window int16) indicator.IIndicatorSeries |
|
}
|
|
|