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.
 
 

27 lines
572 B

package trade
import (
"sig-pub/api/pb"
"sig-pub/pkg/indicator"
"sig-pub/pkg/types"
)
type IRickStrategy interface {
OnSingle(signalSide types.Side)
}
// RickStrategy 风险管理策略
type RickStrategy struct {
indicatorCtx indicator.IIndicatorContext
}
// OnSingle 收到信号时进行评估, 返回过滤后的交易信号
// todo 对交易方向进行信心分数评估, 后续开仓仓位
func (s *RickStrategy) OnSingle(signalSide pb.Side) (side pb.Side) {
k := s.indicatorCtx.Get(0)
price := k.Close
ts := k.Ts
_, _ = price, ts
return signalSide
}