Documentation ¶
Index ¶
Constants ¶
View Source
const ( KRuleF10 = engineBaseRule + 0 // 基础规则 KRuleBase = engineBaseRule + 1 // 基础规则 )
Variables ¶
View Source
var ( ErrRangeOfOpeningTurnZ = exception.New(errorRuleBase+0, "非开盘换手范围") ErrRangeOfOpeningQuantityRatio = exception.New(errorRuleBase+1, "非开盘量比范围") ErrRangeOfOpeningChangeRate = exception.New(errorRuleBase+2, "非开盘涨跌幅范围") ErrRangeOfFundFlow = exception.New(errorRuleBase+3, "非资金流出") )
View Source
var ( ErrF10IgnoreStock = exception.New(errorRuleF10+0, "忽略的个股") ErrF10SubNewStock = exception.New(errorRuleF10+1, "次新股") ErrF10DisableBeijingStockExchange = exception.New(errorRuleF10+2, "禁止北交所") ErrF10DisableChiNextBoard = exception.New(errorRuleF10+3, "禁止创业板") ErrF10DisableSciTechBoard = exception.New(errorRuleF10+4, "禁止科创板") ErrF10PriceRange = exception.New(errorRuleF10+5, "股价控制") ErrF10RangeOfCapital = exception.New(errorRuleF10+6, "非流通盘范围") ErrF10RangeOfSafetyCode = exception.New(errorRuleF10+7, "非安全分范围") ErrF10RangeOfBasicEPS = exception.New(errorRuleF10+8, "非每股收益范围") ErrF10RangeOfBPS = exception.New(errorRuleF10+9, "非净增长范围") ErrF10RangeOfMarketCap = exception.New(errorRuleF10+10, "非市值范围") )
View Source
var (
ErrAlreadyExists = errors.New("the rule already exists") // 规则已经存在
)
Functions ¶
func RegisterFunc ¶ added in v0.5.6
func RegisterFunc(kind Kind, name string, cb func(ruleParameter config.RuleParameter, snapshot factors.QuoteSnapshot) error) error
RegisterFunc 注册规则回调函数
Types ¶
type Kind ¶ added in v0.5.6
type Kind = uint
Kind 规则类型
const (
Pass Kind = 0
)
func Filter ¶ added in v0.6.6
func Filter(ruleParameter config.RuleParameter, snapshot factors.QuoteSnapshot) (passed []uint64, failed Kind, err error)
Filter 遍历所有规则
type Rule ¶
type Rule struct { Exec func(ruleParameter config.RuleParameter, snapshot factors.QuoteSnapshot) error // contains filtered or unexported fields }
Rule 规则接口封装
type RuleImpl ¶ added in v0.5.6
type RuleImpl struct {
// contains filtered or unexported fields
}
func (RuleImpl) Exec ¶ added in v0.5.6
func (r RuleImpl) Exec(rules config.RuleParameter, snapshot factors.QuoteSnapshot) error
func (RuleImpl) RuleMethod ¶ added in v1.0.0
func (r RuleImpl) RuleMethod() func(rules config.RuleParameter, snapshot factors.QuoteSnapshot) error
Click to show internal directories.
Click to hide internal directories.