Documentation ¶
Index ¶
Constants ¶
View Source
const ( RuleBaseF10 = engineBaseRule + 0 // 基础规则 RuleSubNewStock = engineBaseRule + 1 // 次新股 )
View Source
const ( TenThousand = 1e4 // 万 Million = 100 * TenThousand // 百万 Billion = 100 * Million // 1亿 )
Variables ¶
View Source
var ( ErrAlreadyExists = errors.New("rule is already exists") // 规则已经存在 ErrExecuteFailed = errors.New("rule execute failed") // 规则执行失败 )
View Source
var ( ErrIgnoreStock = exception.New(errorRuleBase+0, "忽略的个股") ErrSubNewStock = exception.New(errorRuleBase+1, "次新股") ErrScienceAndTechnologyInnovationBoard = exception.New(errorRuleBase+2, "科创板") ErrPriceRange = exception.New(errorRuleBase+3, "股价控制") ErrRangeOfOpeningTurnZ = exception.New(errorRuleBase+4, "非开盘换手范围") ErrRangeOfOpeningQuantityRatio = exception.New(errorRuleBase+5, "非开盘量比范围") ErrRangeOfOpeningChangeRate = exception.New(errorRuleBase+6, "非开盘涨跌幅范围") ErrF10RangeOfCapital = exception.New(errorRuleBase+7, "非流通盘范围") ErrF10RangeOfSafetyCode = exception.New(errorRuleBase+8, "非安全分范围") ErrF10RangeOfBasicEPS = exception.New(errorRuleBase+9, "非每股收益范围") ErrF10RangeOfBPS = exception.New(errorRuleBase+10, "非净增长范围") )
View Source
var ( RuleParameters = cache.RuleParameter{} OrderParameters = cache.OrderParameter{} )
Functions ¶
func PrintRuleList ¶ added in v0.5.6
func PrintRuleList()
func RegisterFunc ¶ added in v0.5.6
RegisterFunc 注册规则回调函数
Types ¶
type Rule ¶
type Rule interface { // Kind 类型 Kind() Kind // Name 名称 Name() string // Exec 执行, 返回nil即为成功 Exec(snapshot models.QuoteSnapshot) error }
Rule 规则接口
type RuleSubNew ¶ added in v0.5.6
type RuleSubNew struct{}
func (RuleSubNew) Exec ¶ added in v0.5.6
func (r RuleSubNew) Exec(snapshot models.QuoteSnapshot) error
func (RuleSubNew) Kind ¶ added in v0.5.6
func (r RuleSubNew) Kind() Kind
func (RuleSubNew) Name ¶ added in v0.5.6
func (r RuleSubNew) Name() string
Click to show internal directories.
Click to hide internal directories.