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.
30 lines
867 B
30 lines
867 B
package types |
|
|
|
type StrategyName string |
|
|
|
// 下单策略接口 |
|
type Strategy interface { |
|
Meta() StrategyMeta |
|
// init id, 计算完成 publish 时使用id, |
|
// exchange: 封装indicator访问, 封装历史k线访问 |
|
// args: 动态策略参数, 执行时创建 |
|
Init(indId int64, exchange any, args map[string]any) |
|
Indicators() []string // 依赖指标列表, ind -> id(int64) |
|
Emit() // 下单: sell/buy -> 持单,双方向?, score(分数权重) |
|
} |
|
|
|
type StrategyMeta struct { |
|
// Id string `json:"id"` // 策略注册/执行器系统分配 |
|
Name string `json:"name"` |
|
Desc string `json:"desc"` |
|
DescEn string `json:"descEn"` |
|
} |
|
|
|
// KlineServiceClient |
|
// IndicatorClient.Sub(MACD5) stream[Indicator] |
|
// IndicatorClient.Sub(ALMA) stream[Indicator] |
|
// |
|
|
|
// 持单策略接口,动态止盈/止损/加仓/减仓 |
|
type OrderStrategy interface { |
|
}
|
|
|