Documentation ¶
Index ¶
- Constants
- func BoolIndexOf(s stat.Series, n int) bool
- func ComputeFreeCapital(holderList []dfcf.CirculatingShareholder, capital float64) (...)
- func IndexReverse(s stat.Series) stat.Series
- func IsSubNewStockByIpoDate(securityCode, ipoDate, date string) bool
- func SeriesChangeRate(base, v stat.Series) stat.Series
- func SeriesIndexOf(s stat.Series, n int) float64
- func StringIndexOf(s stat.Series, n int) string
- type CompleteData
- type F10
- func (f *F10) ChangingOverDate(date string)
- func (f *F10) Factory(date string, code string) Feature
- func (f *F10) FeatureName() string
- func (f *F10) FromHistory(history History) Feature
- func (f *F10) GetDate() string
- func (f *F10) GetSecurityCode() string
- func (f *F10) Increase(snapshot quotes.Snapshot) Feature
- func (f *F10) Init(barIndex *int, date string) error
- func (f *F10) Key() string
- func (f *F10) Kind() FeatureKind
- func (f *F10) Provider() string
- func (f *F10) Repair(code, cacheDate, featureDate string, complete bool)
- func (f *F10) TurnZ(v any) float64
- func (f *F10) Update(code, cacheDate, featureDate string, complete bool)
- type Factor
- type Feature
- type FeatureKind
- type FeatureSummary
- type History
- func (h *History) Factory(date string, code string) Feature
- func (h *History) FeatureName() string
- func (h *History) FromHistory(history History) Feature
- func (h *History) GetDate() string
- func (h *History) GetSecurityCode() string
- func (h *History) Increase(snapshot quotes.Snapshot) Feature
- func (h *History) Init(barIndex *int, date string) error
- func (h *History) Key() string
- func (h *History) Kind() FeatureKind
- func (h *History) Provider() string
- func (h *History) Repair(code, cacheDate, featureDate string, complete bool)
- func (h *History) Update(code, cacheDate, featureDate string, complete bool)
- type HousNo1
- func (f *HousNo1) Factory(date string, code string) Feature
- func (f *HousNo1) FeatureName() string
- func (f *HousNo1) FromHistory(history History) Feature
- func (f *HousNo1) GetDate() string
- func (f *HousNo1) GetSecurityCode() string
- func (f *HousNo1) Increase(snapshot quotes.Snapshot) Feature
- func (f *HousNo1) Init(barIndex *int, date string) error
- func (f *HousNo1) Key() string
- func (f *HousNo1) Kind() FeatureKind
- func (f *HousNo1) Provider() string
- func (f *HousNo1) Repair(code, cacheDate, featureDate string, complete bool)
- func (f *HousNo1) Update(code, cacheDate, featureDate string, complete bool)
- type IncompleteData
- type Increase
- type Swift
- type Weight
Constants ¶
View Source
const ( FeatureF10 = baseFeature + 1 // 特征数据-基本面 FeatureHistory = baseFeature + 2 // 特征数据-历史 FeatureKLineShap = baseFeature + 3 // 特征数据-K线形态等 FeatureMovingAverage = baseFeature + 4 // 特征数据-移动平均线 FeatureBreaksThroughBox = baseFeature + 5 // 特征数据-有效突破平台 FeatureHousNo1 = featureHous + 1 // 侯总1号策略 FeatureHousNo2 = featureHous + 2 // 侯总2号策略 )
登记所有的特征数据
View Source
const (
CacheL5KeyF10 = "f10"
)
View Source
const (
CacheL5KeyHistory = "history"
)
View Source
const (
SubNewStockYears = 1 // 次新股几年内
)
Variables ¶
This section is empty.
Functions ¶
func ComputeFreeCapital ¶ added in v0.2.0
func ComputeFreeCapital(holderList []dfcf.CirculatingShareholder, capital float64) (top10Capital, freeCapital, capitalChanged, increaseRatio, reductionRatio float64)
ComputeFreeCapital 计算自由流通股本
func IsSubNewStockByIpoDate ¶ added in v0.2.0
IsSubNewStockByIpoDate 检查是否次新股
func SeriesChangeRate ¶ added in v0.2.0
SeriesChangeRate 计算两个序列的净增长
func SeriesIndexOf ¶ added in v0.2.0
SeriesIndexOf 获取序列第n索引的值
Types ¶
type CompleteData ¶ added in v0.2.0
type CompleteData struct {
No1 HousNo1
}
type F10 ¶ added in v0.2.0
type F10 struct { Date string `name:"日期"` // 日期 Code string `name:"代码"` // 代码 Name string `name:"名称"` // 名称 SubNew bool `name:"次新股"` // 是否次新股 VolUnit int `name:"每手"` // 每手单位 DecimalPoint int `name:"小数点"` // 小数点 IpoDate string `name:"上市日期"` // 上市日期 UpdateDate string `name:"更新日期"` // 更新日期 TotalCapital float64 `name:"总股本"` // 总股本 Capital float64 `name:"流通股本"` // 流通股本 FreeCapital float64 `name:"自由流通股本"` // 自由流通股本 Top10Capital float64 `name:"前十大流通股东总股本"` // 前十大流通股东股本 Top10Change float64 `name:"前十大流通股东总股本变化"` //前十大流通股东股本变化 ChangeCapital float64 `name:"前十大流通股东持仓变化"` // 前十大流通股东持仓变化 IncreaseRatio float64 `name:"当期增持比例"` // 当期增持比例 ReductionRatio float64 `name:"当期减持比例"` // 当期减持比例 BPS float64 `name:"每股净资产"` // 每股净资产 BasicEPS float64 `name:"每股收益"` // 每股收益 SafetyScore int `name:"安全分"` // 通达信安全分 Increases int `name:"增持"` // 公告-增持 Reduces int `name:"减持"` // 公告-减持 Risk int `name:"风险数"` // 公告-风险数 RiskKeywords string `name:"风险关键词"` // 公告-风险关键词 }
F10 证券基本面
func (*F10) ChangingOverDate ¶ added in v0.2.0
func (*F10) FeatureName ¶ added in v0.2.0
func (*F10) FromHistory ¶ added in v0.2.0
func (*F10) GetSecurityCode ¶ added in v0.2.0
func (*F10) Kind ¶ added in v0.2.0
func (f *F10) Kind() FeatureKind
type Factor ¶
type Factor interface { Init() // 初始化 Name() string // 因子名称 Weight() uint64 // 权重 Execute(securityCode, date string) (ok bool) // 执行 }
Factor 因子
type Feature ¶
type Feature interface { Provider() string Factory(date string, code string) Feature // 工厂 Kind() FeatureKind // 类型 FeatureName() string // 特征名称 Key() string // 缓存关键字 Init(barIndex *int, date string) error // 初始化, 加载配置信息 GetDate() string // 日期 GetSecurityCode() string // 证券代码 FromHistory(history History) Feature // 从历史数据加载 Update(code, cacheDate, featureDate string, complete bool) // 更新数据 Repair(code, cacheDate, featureDate string, complete bool) // 回补数据 Increase(snapshot quotes.Snapshot) Feature // 增量计算, 用快照增量计算特征 }
Feature 特征
type FeatureKind ¶
type FeatureKind = uint64
type FeatureSummary ¶ added in v0.2.3
type FeatureSummary struct { Type FeatureKind Key string Name string }
type History ¶
type History struct { Date string `name:"日期"` // 日期, 数据落地的日期 Code string `name:"代码"` // 代码 MA3 float64 `name:"3日均价"` // 3日均价 MV3 float64 `name:"3日均量"` // 3日均量 MA5 float64 `name:"5日均价"` // 5日均价 MV5 float64 `name:"5日均量"` // 5日均量 MA10 float64 `name:"10日均价"` // 10日均价 MV10 float64 `name:"10日均量"` // 10日均量 MA20 float64 `name:"20日均价"` // 20日均价 MV20 float64 `name:"20日均量"` // 20日均量 QSFZ bool `name:"QSFZ: 反转信号"` // QSFZ: 反转信号 CP float64 `name:"QSFZ: 股价涨幅"` // QSFZ: 股价涨幅 CV float64 `name:"QSFZ: 成交量涨幅"` // QSFZ: 成交量涨幅 VP float64 `name:"QSFZ: 价量比"` // QSFZ: 价量比 VP3 float64 `name:"QSFZ: 3日价量比"` // QSFZ: 3日价量比 VP5 float64 `name:"QSFZ: 5日价量比"` // QSFZ: 5日价量比 Payloads IncompleteData // 扩展的半成品数据 Last CompleteData // 上一个交易日的数据 UpdateTime string `name:"更新时间"` // 更新时间 }
History 历史整合数据
func NewHistory ¶ added in v0.2.0
func (*History) FeatureName ¶ added in v0.2.0
func (*History) FromHistory ¶ added in v0.2.0
func (*History) GetSecurityCode ¶ added in v0.2.0
func (*History) Kind ¶ added in v0.2.0
func (h *History) Kind() FeatureKind
type HousNo1 ¶ added in v0.2.0
func (*HousNo1) FeatureName ¶ added in v0.2.0
func (*HousNo1) FromHistory ¶ added in v0.2.0
func (*HousNo1) GetSecurityCode ¶ added in v0.2.0
func (*HousNo1) Kind ¶ added in v0.2.0
func (f *HousNo1) Kind() FeatureKind
type IncompleteData ¶ added in v0.2.0
type IncompleteData struct {
No1 HousNo1
}
IncompleteData 不完整的数据
type Increase ¶ added in v0.2.3
type Increase[T any] interface { Add(data T) T }
Increase 增量数据计算接口
deprecated: 不推荐
Source Files ¶
Click to show internal directories.
Click to hide internal directories.