Documentation ¶
Index ¶
Constants ¶
View Source
const ( KRuleF10 = engineBaseRule + 0 // 基础规则 KRuleBase = engineBaseRule + 1 // 基础规则 )
View Source
const ( TenThousand = 1e4 // 万 Million = 100 * TenThousand // 百万 Billion = 100 * Million // 1亿 )
Variables ¶
View Source
var ( ErrAlreadyExists = errors.New("the rule already exists") // 规则已经存在 ErrExecuteFailed = errors.New("the rule execution failed") // 规则执行失败 )
View Source
var ( ErrRangeOfOpeningTurnZ = exception.New(errorRuleBase+0, "非开盘换手范围") ErrRangeOfOpeningQuantityRatio = exception.New(errorRuleBase+1, "非开盘量比范围") ErrRangeOfOpeningChangeRate = exception.New(errorRuleBase+2, "非开盘涨跌幅范围") )
View Source
var ( RuleParameters config.RuleParameter OrderParameters config.OrderParameter )
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, "非净增长范围") )
Functions ¶
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 规则接口
Click to show internal directories.
Click to hide internal directories.