Documentation ¶
Overview ¶
Package factors 特征/因子相关的功能
包括: 基础数据, 基本面, 常用历史特征以及1号策略数据
Index ¶
- Constants
- Variables
- func BasicKLine(securityCode string) pandas.DataFrame
- func ComputeFreeCapital(holderList []dfcf.CirculatingShareholder, capital float64) (...)
- func GetCacheKLine(code string, adjust ...bool) pandas.DataFrame
- func GetDataDescript(kind cache.Kind) cache.DataSummary
- func GetKLineAll(securityCode string, argv ...int) pandas.DataFrame
- func GetMarginTradingTarget(code string) (dfcf.SecurityMarginTrading, bool)
- func GetTimestamp() string
- func IntegrateQuarterlyReports(barIndex int, date string) map[string]dfcf.QuarterlyReport
- func IsSubNewStockByIpoDate(securityCode, ipoDate, date string) bool
- func KLine(securityCode string) pandas.DataFrame
- func KLineToWeekly(kline pandas.DataFrame) pandas.DataFrame
- func MarginTradingTargetInit(date string)
- func MonthlyKLine(securityCode string, cacheKLine ...[]base.KLine) (df pandas.DataFrame)
- func PriceDigits(securityCode string) int
- func RefreshL5Misc()
- func RegisterFeatureRotationAdapter(key string, adapter FeatureRotationAdapter)
- func SetKLineOffset(days int)
- func SwitchDate(date string)
- func UpdateL5Misc(misc *Misc)
- func WeeklyKLine(securityCode string, cacheKLine ...[]base.KLine) (df pandas.DataFrame)
- type Box
- func (this *Box) Factory(date string, code string) Feature
- func (this *Box) FromHistory(history History) Feature
- func (this *Box) GetDate() string
- func (this *Box) GetSecurityCode() string
- func (this *Box) Increase(snapshot QuoteSnapshot) Feature
- func (this *Box) Init(ctx context.Context, date string) error
- func (this *Box) Repair(code, cacheDate, featureDate string, complete bool)
- func (this *Box) Update(code, cacheDate, featureDate string, complete bool)
- func (this *Box) ValidateSample() error
- type Cache1D
- func (this *Cache1D[T]) Apply(merge func(code string, local *T) (updated bool))
- func (this *Cache1D[T]) Check(cacheDate, featureDate string)
- func (this *Cache1D[T]) Checkout(date ...string)
- func (this *Cache1D[T]) Factory(date, securityCode string) Feature
- func (this *Cache1D[T]) Filter(f func(v T) bool) []T
- func (this *Cache1D[T]) Get(securityCode string, date ...string) *T
- func (this *Cache1D[T]) Init(ctx context.Context, date, securityCode string) error
- func (this *Cache1D[T]) Key() string
- func (this *Cache1D[T]) Kind() cache.Kind
- func (this *Cache1D[T]) Length() int
- func (this *Cache1D[T]) Merge(p *treemap.Map)
- func (this *Cache1D[T]) Name() string
- func (this *Cache1D[T]) Owner() string
- func (this *Cache1D[T]) Print(code string, date ...string)
- func (this *Cache1D[T]) ReplaceCache()
- func (this *Cache1D[T]) Set(securityCode string, newValue T, date ...string)
- func (this *Cache1D[T]) Usage() string
- type CompleteData
- type DataKLine
- func (k *DataKLine) Check(cacheDate, featureDate string) error
- func (k *DataKLine) Checkout(securityCode, date string)
- func (k *DataKLine) Clone(date, code string) DataSet
- func (k *DataKLine) Filename(date, code string) string
- func (k *DataKLine) GetDate() string
- func (k *DataKLine) GetSecurityCode() string
- func (k *DataKLine) Increase(snapshot quotes.Snapshot)
- func (k *DataKLine) Init(ctx context.Context, date string) error
- func (k *DataKLine) Print(code string, date ...string)
- func (k *DataKLine) Repair(date string)
- func (k *DataKLine) Update(date string)
- type DataMinutes
- func (this *DataMinutes) Clone(date string, code string) DataSet
- func (this *DataMinutes) Increase(snapshot quotes.Snapshot)
- func (this *DataMinutes) Init(ctx context.Context, date string) error
- func (this *DataMinutes) Print(code string, date ...string)
- func (this *DataMinutes) Repair(date string)
- func (this *DataMinutes) Update(date string)
- type DataPreviewReport
- func (this *DataPreviewReport) Clone(date string, code string) DataSet
- func (this *DataPreviewReport) Increase(snapshot quotes.Snapshot)
- func (this *DataPreviewReport) Init(ctx context.Context, date string) error
- func (this *DataPreviewReport) Print(code string, date ...string)
- func (this *DataPreviewReport) Repair(date string)
- func (this *DataPreviewReport) Update(date string)
- type DataQuarterlyReport
- func (r *DataQuarterlyReport) Check(cacheDate, featureDate string) error
- func (r *DataQuarterlyReport) Checkout(securityCode, date string)
- func (r *DataQuarterlyReport) Clone(date string, code string) DataSet
- func (r *DataQuarterlyReport) Filename(date, code string) string
- func (r *DataQuarterlyReport) GetDate() string
- func (r *DataQuarterlyReport) GetSecurityCode() string
- func (r *DataQuarterlyReport) Increase(snapshot quotes.Snapshot)
- func (r *DataQuarterlyReport) Init(ctx context.Context, date string) error
- func (r *DataQuarterlyReport) Print(code string, date ...string)
- func (r *DataQuarterlyReport) Repair(date string)
- func (r *DataQuarterlyReport) Update(date string)
- type DataSafetyScoredeprecated
- type DataSet
- type DataWideKLine
- func (this *DataWideKLine) Clone(date string, code string) DataSet
- func (this *DataWideKLine) Increase(snapshot quotes.Snapshot)
- func (this *DataWideKLine) Init(ctx context.Context, date string) error
- func (this *DataWideKLine) Print(code string, date ...string)
- func (this *DataWideKLine) Repair(date string)
- func (this *DataWideKLine) Update(date string)
- type DataXdxr
- func (x *DataXdxr) Clone(date string, code string) DataSet
- func (x *DataXdxr) Filename(date, code string) string
- func (x *DataXdxr) GetDate() string
- func (x *DataXdxr) GetSecurityCode() string
- func (x *DataXdxr) Increase(snapshot quotes.Snapshot)
- func (x *DataXdxr) Init(ctx context.Context, date string) error
- func (x *DataXdxr) Print(code string, date ...string)
- func (x *DataXdxr) Repair(date string)
- func (x *DataXdxr) Update(date string)
- type DuoKongQuShi
- type F10
- func (this *F10) Factory(date string, code string) Feature
- func (this *F10) FromHistory(history History) Feature
- func (this *F10) GetDate() string
- func (this *F10) GetSecurityCode() string
- func (this *F10) Increase(snapshot QuoteSnapshot) Feature
- func (this *F10) Init(ctx context.Context, date string) error
- func (this *F10) IsReportingRiskPeriod() bool
- func (this *F10) Repair(code, cacheDate, featureDate string, complete bool)
- func (this *F10) TurnZ(v any) float64
- func (this *F10) Update(code, cacheDate, featureDate string, complete bool)
- func (this *F10) ValidateSample() error
- type Feature
- type FeatureRotationAdapter
- type History
- func (this *History) Factory(date string, code string) Feature
- func (this *History) FromHistory(history History) Feature
- func (this *History) GetDate() string
- func (this *History) GetMV5() float64
- func (this *History) GetSecurityCode() string
- func (this *History) Increase(snapshot QuoteSnapshot) Feature
- func (this *History) Init(ctx context.Context, date string) error
- func (this *History) Repair(code, cacheDate, featureDate string, complete bool)
- func (this *History) Update(code, cacheDate, featureDate string, complete bool)
- func (this *History) ValidateSample() error
- type HousNo1
- func (this *HousNo1) Factory(date string, code string) Feature
- func (this *HousNo1) FromHistory(history History) Feature
- func (this *HousNo1) GetDate() string
- func (this *HousNo1) GetSecurityCode() string
- func (this *HousNo1) Increase(snapshot QuoteSnapshot) Feature
- func (this *HousNo1) Init(ctx context.Context, date string) error
- func (this *HousNo1) Repair(code, cacheDate, featureDate string, complete bool)
- func (this *HousNo1) Update(code, cacheDate, featureDate string, complete bool)
- func (this *HousNo1) ValidateSample() error
- type IncompleteData
- type InvestmentSentimentMaster
- func (this *InvestmentSentimentMaster) Factory(date string, code string) Feature
- func (this *InvestmentSentimentMaster) FromHistory(history History) Feature
- func (this *InvestmentSentimentMaster) GetDate() string
- func (this *InvestmentSentimentMaster) GetSecurityCode() string
- func (this *InvestmentSentimentMaster) Increase(snapshot QuoteSnapshot) Feature
- func (this *InvestmentSentimentMaster) Init(ctx context.Context, date string) error
- func (this *InvestmentSentimentMaster) Repair(securityCode, cacheDate, featureDate string, whole bool)
- func (this *InvestmentSentimentMaster) Update(code, cacheDate, featureDate string, whole bool)
- func (this *InvestmentSentimentMaster) ValidateSample() error
- type JuXianDongXiang
- type KLineBox
- type Manifest
- type Misc
- func (this *Misc) Factory(date string, code string) Feature
- func (this *Misc) FromHistory(history History) Feature
- func (this *Misc) GetDate() string
- func (this *Misc) GetSecurityCode() string
- func (this *Misc) Increase(snapshot QuoteSnapshot) Feature
- func (this *Misc) Init(ctx context.Context, date string) error
- func (this *Misc) Repair(code, cacheDate, featureDate string, complete bool)
- func (this *Misc) Update(code, cacheDate, featureDate string, complete bool)
- func (this *Misc) ValidateSample() error
- type MiscKLine
- type MovingAverage
- type PowerTrend
- type QuShiFanZhuan
- type QuoteSnapshot
- type SecurityFeature
- type ShapeType
- type Trait
- type TransactionRecord
- func (r *TransactionRecord) Check(cacheDate, featureDate string) error
- func (r *TransactionRecord) Checkout(securityCode, date string)
- func (r *TransactionRecord) Clone(date string, code string) DataSet
- func (r *TransactionRecord) Filename(date, code string) string
- func (r *TransactionRecord) GetDate() string
- func (r *TransactionRecord) GetSecurityCode() string
- func (r *TransactionRecord) Increase(snapshot quotes.Snapshot)
- func (r *TransactionRecord) Init(ctx context.Context, date string) error
- func (r *TransactionRecord) Print(code string, date ...string)
- func (r *TransactionRecord) Repair(date string)
- func (r *TransactionRecord) Update(date string)
- type TurnoverDataSummary
- type Weight
Constants ¶
const ( BaseXdxr = cache.PluginMaskBaseData | (baseKind + 1) // 基础数据-除权除息 BaseKLine = cache.PluginMaskBaseData | (baseKind + 2) // 基础数据-基础K线 BaseTransaction = cache.PluginMaskBaseData | (baseKind + 3) // 基础数据-历史成交 BaseMinutes = cache.PluginMaskBaseData | (baseKind + 4) // 基础数据-分时数据 BaseQuarterlyReports = cache.PluginMaskBaseData | (baseKind + 5) // 基础数据-季报 BaseSafetyScore = cache.PluginMaskBaseData | (baseKind + 6) // 基础数据-安全分 BaseWideKLine = cache.PluginMaskBaseData | (baseKind + 7) // 基础数据-宽表 BasePerformanceForecast = cache.PluginMaskBaseData | (baseKind + 8) // 基础数据-业绩预告 )
const ( InvalidPeriod = -1 // 无效的周期 InvalidWeight = float64(-99.99) // 无效的权重值 )
const ( FeatureF10 = baseFeature + 1 // 特征数据-基本面 FeatureHistory = baseFeature + 2 // 特征数据-历史 FeatureNo1 = baseFeature + 3 // 特征数据-1号策略 FeatureMisc = baseFeature + 4 // 特征数据-Misc FeatureBreaksThroughBox = baseFeature + 5 // 特征数据-box FeatureKLineShap = baseFeature + 6 // 特征数据-K线形态等 FeatureInvestmentSentimentMaster = baseFeature + 7 // 狩猎者-情绪周期 )
登记所有的特征数据
const (
S8PeriodOfLimitUp = 30
)
const (
SubNewStockYears = 1 // 次新股几年内
)
Variables ¶
var ( FBarsProtocolFields = []string{"Open", "Close", "High", "Low", "Vol", "Amount", "DateTime", "UpCount", "DownCount"} FBarsRawFields = []string{"open", "close", "high", "low", "volume", "amount", "date", "up", "down"} FBarsHalfFields = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "open_volume", "open_turnz", "open_unmatched", "close_volume", "close_turnz", "close_unmatched", "inner_volume", "outer_volume", "inner_amount", "outer_amount"} FBarsWideFields = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "last_close", "change_rate", "open_volume", "open_turnz", "open_unmatched", "close_volume", "close_turnz", "close_unmatched", "inner_volume", "outer_volume", "inner_amount", "outer_amount"} )
var (
ErrInvalidFeatureSample = errors.New("无效的特征数据样本")
)
Functions ¶
func BasicKLine ¶ added in v0.8.8
BasicKLine 基础日K线
func ComputeFreeCapital ¶ added in v0.2.0
func ComputeFreeCapital(holderList []dfcf.CirculatingShareholder, capital float64) (top10Capital, freeCapital, capitalChanged, increaseRatio, reductionRatio float64)
ComputeFreeCapital 计算自由流通股本
func GetDataDescript ¶ added in v0.2.0
func GetDataDescript(kind cache.Kind) cache.DataSummary
func GetKLineAll ¶ added in v0.8.8
GetKLineAll 获取日K线
func GetMarginTradingTarget ¶ added in v1.7.5
func GetMarginTradingTarget(code string) (dfcf.SecurityMarginTrading, bool)
GetMarginTradingTarget 获取两融数据
func GetTimestamp ¶ added in v0.8.1
func GetTimestamp() string
GetTimestamp 时间戳
格式: YYYY-MM-DD hh:mm:ss.SSS
func IntegrateQuarterlyReports ¶ added in v0.8.8
func IntegrateQuarterlyReports(barIndex int, date string) map[string]dfcf.QuarterlyReport
IntegrateQuarterlyReports 更新季报数据
func IsSubNewStockByIpoDate ¶ added in v0.2.0
IsSubNewStockByIpoDate 检查是否次新股
func MarginTradingTargetInit ¶ added in v1.7.5
func MarginTradingTargetInit(date string)
MarginTradingTargetInit 一次性缓存两融数据, 交易日9点后更新上一个交易的两融数据
func MonthlyKLine ¶ added in v0.8.8
MonthlyKLine 月K线
func RegisterFeatureRotationAdapter ¶ added in v1.3.0
func RegisterFeatureRotationAdapter(key string, adapter FeatureRotationAdapter)
Types ¶
type Box ¶ added in v0.8.8
type Box struct { cache.DataSummary `dataframe:"-"` Code string `name:"证券代码" dataframe:"证券代码"` // 证券代码 Date string `name:"数据日期" dataframe:"数据日期"` // 数据日期 DoubletPeriod int `name:"倍量周期" dataframe:"倍量周期"` // 倍量周期 DoubleHigh float64 `name:"倍量最高" dataframe:"倍量最高"` // 倍量最高 DoubleLow float64 `name:"倍量最低" dataframe:"倍量最低"` // 倍量最低 Buy bool `name:"买入信号" dataframe:"买入信号"` // 买入信号 HalfPeriod int `name:"半量周期" dataframe:"半量周期"` // 半量周期 HalfHigh float64 `name:"半量最高" dataframe:"半量最高"` // 半量最高 HalfLow float64 `name:"半量最低" dataframe:"半量最低"` // 半量最低 Sell bool `name:"卖出信号" dataframe:"卖出信号"` // 卖出信号 TendencyPeriod int `name:"趋势周期" dataframe:"趋势周期"` // 趋势周期 QSFZ bool `name:"QSFZ" dataframe:"QSFZ"` // QSFZ QSCP float64 `name:"QSCP" dataframe:"QSCP"` // QSFZ: QSCP QSCV float64 `name:"QSCV" dataframe:"QSCV"` // QSFZ: QSCV QSVP float64 `name:"QSVP" dataframe:"QSVP"` // QSFZ: QSVP QSVP3 float64 `name:"QSVP3" dataframe:"QSVP3"` // QSFZ: QSVP3 QSVP5 float64 `name:"QSVP5" dataframe:"QSVP5"` // QSFZ: QSVP5 DkCol float64 `name:"DkCol" dataframe:"DkCol"` // dkqs: 能量柱 DkD float64 `name:"dkd" dataframe:"dkd"` // dkqs: 多头力量 DkK float64 `name:"dkk" dataframe:"dkk"` // dkqs: 空头力量 DkB bool `name:"dkb" dataframe:"dkb"` // dkqs: buy DkS bool `name:"dks" dataframe:"dks"` // dkqs: sell DxDivergence float64 `name:"dxdivergence" dataframe:"dxdivergence"` // madx: 综合发散度评估值 DxDm0 float64 `name:"dxdm0" dataframe:"dxdm0"` // madx: 超短线均线发散度 DxDm1 float64 `name:"dxdm1" dataframe:"dxdm1"` // madx: 短线均线发散度 DxDm2 float64 `name:"dxdm2" dataframe:"dxdm2"` // madx: 中线均线发散度 DxB bool `name:"dxb" dataframe:"dxb"` // madx: 买入 State uint64 `name:"样本状态" dataframe:"样本状态"` // 样本状态 }
Box 平台特征数据
func (*Box) FromHistory ¶ added in v0.8.8
func (*Box) GetSecurityCode ¶ added in v0.8.8
func (*Box) Increase ¶ added in v0.8.8
func (this *Box) Increase(snapshot QuoteSnapshot) Feature
func (*Box) ValidateSample ¶ added in v0.8.8
ValidateSample 验证样本数据
type Cache1D ¶ added in v0.8.8
Cache1D 缓存所有证券代码的特征组合数据
每天1个证券代码1条数据
func NewCache1D ¶ added in v0.8.8
NewCache1D 创建一个新的C1D对象
key支持多级相对路径, 比如a/b, 创建的路径是~/.quant1x/a/b.yyyy-mm-dd
func (*Cache1D[T]) ReplaceCache ¶ added in v0.8.8
func (this *Cache1D[T]) ReplaceCache()
ReplaceCache 替换当前缓存数据
type CompleteData ¶ added in v0.2.0
type CompleteData struct {
No1 HousNo1
}
type DataKLine ¶ added in v0.8.8
type DataKLine struct { cache.DataSummary Date string Code string }
func (*DataKLine) GetSecurityCode ¶ added in v0.8.8
type DataMinutes ¶ added in v0.8.8
type DataMinutes struct {
Manifest
}
DataMinutes 分时数据
func (*DataMinutes) Clone ¶ added in v0.8.8
func (this *DataMinutes) Clone(date string, code string) DataSet
func (*DataMinutes) Increase ¶ added in v0.8.8
func (this *DataMinutes) Increase(snapshot quotes.Snapshot)
func (*DataMinutes) Init ¶ added in v0.8.8
func (this *DataMinutes) Init(ctx context.Context, date string) error
func (*DataMinutes) Print ¶ added in v0.8.8
func (this *DataMinutes) Print(code string, date ...string)
func (*DataMinutes) Repair ¶ added in v0.8.8
func (this *DataMinutes) Repair(date string)
func (*DataMinutes) Update ¶ added in v0.8.8
func (this *DataMinutes) Update(date string)
type DataPreviewReport ¶ added in v0.8.8
type DataPreviewReport struct {
Manifest
}
DataPreviewReport 业绩预告(Listed Companies'Performance Forecast)
func (*DataPreviewReport) Clone ¶ added in v0.8.8
func (this *DataPreviewReport) Clone(date string, code string) DataSet
func (*DataPreviewReport) Increase ¶ added in v0.8.8
func (this *DataPreviewReport) Increase(snapshot quotes.Snapshot)
func (*DataPreviewReport) Init ¶ added in v0.8.8
func (this *DataPreviewReport) Init(ctx context.Context, date string) error
func (*DataPreviewReport) Print ¶ added in v0.8.8
func (this *DataPreviewReport) Print(code string, date ...string)
func (*DataPreviewReport) Repair ¶ added in v0.8.8
func (this *DataPreviewReport) Repair(date string)
func (*DataPreviewReport) Update ¶ added in v0.8.8
func (this *DataPreviewReport) Update(date string)
type DataQuarterlyReport ¶ added in v0.8.8
type DataQuarterlyReport struct { cache.DataSummary Date string Code string // contains filtered or unexported fields }
DataQuarterlyReport 季报
func (*DataQuarterlyReport) Check ¶ added in v0.8.8
func (r *DataQuarterlyReport) Check(cacheDate, featureDate string) error
func (*DataQuarterlyReport) Checkout ¶ added in v0.8.8
func (r *DataQuarterlyReport) Checkout(securityCode, date string)
func (*DataQuarterlyReport) Clone ¶ added in v0.8.8
func (r *DataQuarterlyReport) Clone(date string, code string) DataSet
func (*DataQuarterlyReport) Filename ¶ added in v0.8.8
func (r *DataQuarterlyReport) Filename(date, code string) string
func (*DataQuarterlyReport) GetDate ¶ added in v0.8.8
func (r *DataQuarterlyReport) GetDate() string
func (*DataQuarterlyReport) GetSecurityCode ¶ added in v0.8.8
func (r *DataQuarterlyReport) GetSecurityCode() string
func (*DataQuarterlyReport) Increase ¶ added in v0.8.8
func (r *DataQuarterlyReport) Increase(snapshot quotes.Snapshot)
func (*DataQuarterlyReport) Init ¶ added in v0.8.8
func (r *DataQuarterlyReport) Init(ctx context.Context, date string) error
func (*DataQuarterlyReport) Print ¶ added in v0.8.8
func (r *DataQuarterlyReport) Print(code string, date ...string)
func (*DataQuarterlyReport) Repair ¶ added in v0.8.8
func (r *DataQuarterlyReport) Repair(date string)
func (*DataQuarterlyReport) Update ¶ added in v0.8.8
func (r *DataQuarterlyReport) Update(date string)
type DataSafetyScore
deprecated
added in
v0.8.8
type DataSet ¶ added in v0.8.8
type DataSet interface { // Clone 克隆一个DataSet, 是所有写操作的基础 Clone(date string, code string) DataSet cache.Manifest // Update 更新数据 Update(date string) // Repair 回补数据 Repair(date string) // Increase 增量计算, 用快照增量计算特征 Increase(snapshot quotes.Snapshot) }
DataSet 数据层, 数据集接口 smart
数据集是基础数据, 应当遵循结构简单, 尽量减小缓存的文件数量, 加载迅速 检索的规则是按日期和代码进行查询
type DataWideKLine ¶ added in v1.1.8
type DataWideKLine struct {
Manifest
}
DataWideKLine 宽表
func (*DataWideKLine) Clone ¶ added in v1.1.8
func (this *DataWideKLine) Clone(date string, code string) DataSet
func (*DataWideKLine) Increase ¶ added in v1.1.8
func (this *DataWideKLine) Increase(snapshot quotes.Snapshot)
func (*DataWideKLine) Init ¶ added in v1.1.8
func (this *DataWideKLine) Init(ctx context.Context, date string) error
func (*DataWideKLine) Print ¶ added in v1.1.8
func (this *DataWideKLine) Print(code string, date ...string)
func (*DataWideKLine) Repair ¶ added in v1.1.8
func (this *DataWideKLine) Repair(date string)
func (*DataWideKLine) Update ¶ added in v1.1.8
func (this *DataWideKLine) Update(date string)
type DataXdxr ¶ added in v0.8.8
type DataXdxr struct { cache.DataSummary Date string Code string }
DataXdxr 除权除息
func (*DataXdxr) GetSecurityCode ¶ added in v0.8.8
type DuoKongQuShi ¶ added in v0.8.8
DuoKongQuShi 多空趋势
type F10 ¶ added in v0.2.0
type F10 struct { cache.DataSummary `dataframe:"-"` Date string `name:"日期" dataframe:"Date"` // 日期 Code string `name:"代码" dataframe:"Code"` // 证券代码 SecurityName string `name:"名称" dataframe:"Name"` // 证券名称 SubNew bool `name:"次新股" dataframe:"SubNew"` // 是否次新股 MarginTradingTarget bool `name:"两融" dataframe:"MarginTradingTarget"` // 是否两融标的 VolUnit int `name:"每手" dataframe:"VolUnit"` // 每手单位 DecimalPoint int `name:"小数点" dataframe:"DecimalPoint"` // 小数点 IpoDate string `name:"上市日期" dataframe:"IpoDate"` // 上市日期 UpdateDate string `name:"更新日期" dataframe:"UpdateDate"` // 更新日期 TotalCapital float64 `name:"总股本" dataframe:"TotalCapital"` // 总股本 Capital float64 `name:"流通股本" dataframe:"Capital"` // 流通股本 FreeCapital float64 `name:"自由流通股本" dataframe:"FreeCapital"` // 自由流通股本 Top10Capital float64 `name:"前十大流通股东总股本" dataframe:"Top10Capital"` // 前十大流通股东股本 Top10Change float64 `name:"前十大流通股东总股本变化" dataframe:"Top10Change"` //前十大流通股东股本变化 ChangeCapital float64 `name:"前十大流通股东持仓变化" dataframe:"ChangeCapital"` // 前十大流通股东持仓变化 IncreaseRatio float64 `name:"当期增持比例" dataframe:"IncreaseRatio"` // 当期增持比例 ReductionRatio float64 `name:"当期减持比例" dataframe:"ReductionRatio"` // 当期减持比例 QuarterlyYearQuarter string `name:"季报期" dataframe:"quarterly_year_quarter"` // 当前市场处于哪个季报期, 用于比较个股的季报数据是否存在拖延的情况 QDate string `name:"新报告期" dataframe:"qdate"` // 最新报告期 AnnualReportDate string `name:"年报披露日期" dataframe:"annual_report_date"` // 年报披露日期 QuarterlyReportDate string `name:"季报披露日期" dataframe:"quarterly_report_date"` // 最新季报披露日期 TotalOperateIncome float64 `name:"营业总收入" dataframe:"TotalOperateIncome"` // 当期营业总收入 BPS float64 `name:"每股净资产" dataframe:"BPS"` // 每股净资产 BasicEPS float64 `name:"每股收益" dataframe:"BasicEPS"` // 每股收益 DeductBasicEPS float64 `name:"每股收益(扣除)" dataframe:"DeductBasicEPS"` // 每股收益(扣除) SafetyScore int `name:"安全分" dataframe:"SafetyScore"` // 通达信安全分 Increases int `name:"增持" dataframe:"Increases"` // 公告-增持 Reduces int `name:"减持" dataframe:"Reduces"` // 公告-减持 Risk int `name:"风险数" dataframe:"Risk"` // 公告-风险数 RiskKeywords string `name:"风险关键词" dataframe:"RiskKeywords"` // 公告-风险关键词 UpdateTime string `name:"更新时间" dataframe:"update_time"` // 更新时间 State uint64 `name:"样本状态" dataframe:"样本状态"` }
F10 证券基本面
func (*F10) FromHistory ¶ added in v0.2.0
func (*F10) GetSecurityCode ¶ added in v0.2.0
func (*F10) Increase ¶ added in v0.2.0
func (this *F10) Increase(snapshot QuoteSnapshot) Feature
func (*F10) IsReportingRiskPeriod ¶ added in v1.7.2
IsReportingRiskPeriod 是否财报披露前夕
func (*F10) ValidateSample ¶ added in v0.8.1
type Feature ¶
type Feature interface { cache.Manifest cache.Future // Factory 工厂 Factory(date string, code string) Feature Trait }
Feature 特征
type FeatureRotationAdapter ¶ added in v1.3.0
type FeatureRotationAdapter interface { // Name 名称 Name() string // Checkout 加载指定日期的缓存 Checkout(date ...string) // Merge 合并数据 Merge(p *treemap.Map) // Factory 工厂 Factory(date, securityCode string) Feature }
FeatureRotationAdapter 特征缓存日旋转适配器
一天一个特征组合缓存文件
func Get ¶ added in v0.8.8
func Get(key string) FeatureRotationAdapter
type History ¶
type History struct { cache.DataSummary `dataframe:"-"` Date string `name:"日期" dataframe:"date"` // 日期, 数据落地的日期 Code string `name:"代码" dataframe:"code"` // 代码 MA2 float64 `name:"2日均价" dataframe:"ma2"` // 2日均价 MA3 float64 `name:"3日均价" dataframe:"ma3"` // 3日均价 MV3 float64 `name:"3日均量" dataframe:"mv3"` // 3日均量 MA4 float64 `name:"4日均价" dataframe:"ma4"` // 4日均价 MA5 float64 `name:"5日均价" dataframe:"ma5"` // 5日均价 MV5 float64 `name:"5日均量" dataframe:"mv5"` // 5日均量 MA9 float64 `name:"9日均价" dataframe:"ma9"` // 9日均价 MV9 float64 `name:"9日均量" dataframe:"mv9"` // 9日均量 MA10 float64 `name:"10日均价" dataframe:"ma10"` // 10日均价 MV10 float64 `name:"10日均量" dataframe:"mv10"` // 10日均量 MA19 float64 `name:"19日均价" dataframe:"ma19"` // 19日均价 MV19 float64 `name:"19日均量" dataframe:"mv19"` // 19日均量 MA20 float64 `name:"20日均价" dataframe:"ma20"` // 20日均价 MV20 float64 `name:"20日均量" dataframe:"mv20"` // 20日均量 OPEN float64 `name:"开盘" dataframe:"open"` // 昨日开盘 CLOSE float64 `name:"收盘" dataframe:"close"` // 昨日收盘 HIGH float64 `name:"最高" dataframe:"high"` // 昨日最高 LOW float64 `name:"最低" dataframe:"low"` // 昨日最低 VOL float64 `name:"成交量" dataframe:"vol"` // 昨日成交量 AMOUNT float64 `name:"成交额" dataframe:"amount"` // 昨日成交额 AveragePrice float64 `name:"均价" dataframe:"average_price"` // 昨日均价 Payloads IncompleteData `name:"payloads" dataframe:"payloads"` // 扩展的半成品数据 Last CompleteData `name:"last" dataframe:"last"` // 上一个交易日的数据 UpdateTime string `name:"更新时间" dataframe:"update_time"` // 更新时间 State uint64 `name:"样本状态" dataframe:"样本状态"` }
History 历史整合数据
记录重要的截止上一个交易日的数据
func GetL5History ¶ added in v0.8.8
func NewHistory ¶ added in v0.2.0
func (*History) FromHistory ¶ added in v0.2.0
func (*History) GetSecurityCode ¶ added in v0.2.0
func (*History) Increase ¶ added in v0.2.0
func (this *History) Increase(snapshot QuoteSnapshot) Feature
func (*History) ValidateSample ¶ added in v0.8.1
type HousNo1 ¶ added in v0.2.0
type HousNo1 struct { cache.DataSummary `dataframe:"-"` MA5 float64 `dataframe:"ma5"` MA10 float64 `dataframe:"ma10"` MA20 float64 `dataframe:"ma20"` }
func (*HousNo1) FromHistory ¶ added in v0.2.0
func (*HousNo1) GetSecurityCode ¶ added in v0.2.0
func (*HousNo1) Increase ¶ added in v0.2.0
func (this *HousNo1) Increase(snapshot QuoteSnapshot) Feature
func (*HousNo1) ValidateSample ¶ added in v0.8.1
type IncompleteData ¶ added in v0.2.0
type IncompleteData struct {
No1 HousNo1
}
IncompleteData 不完整的数据
type InvestmentSentimentMaster ¶ added in v1.7.5
type InvestmentSentimentMaster struct { cache.DataSummary `dataframe:"-"` Date string `name:"日期" dataframe:"日期"` // 数据日期 Code string `name:"证券代码" dataframe:"证券代码"` // 证券代码 PN int `name:"观察周期" dataframe:"pn"` ZDF float64 `name:"涨跌幅" dataframe:"zdf"` R1CLOSE float64 `name:"昨收盘" dataframe:"r1Close"` ZTJ float64 `name:"涨停价" dataframe:"ztj"` CTJ bool `name:"涨停" dataframe:"ctj"` BN int `name:"板数" dataframe:"bn"` FTZ int `name:"距离首次涨停" dataframe:"ftz"` TN int `name:"天数" dataframe:"tn"` TIAN int `name:"天" dataframe:"tian"` BAN int `name:"板" dataframe:"ban"` ZHANG int `name:"涨" dataframe:"zhang"` PING int `name:"平" dataframe:"ping"` DIE int `name:"跌" dataframe:"die"` OH float64 `name:"周期内最高价" dataframe:"oh"` COH bool `name:"是否周期内最高价" dataframe:"coh"` OHN int `name:"最高价周期" dataframe:"ohn"` OL float64 `name:"周期内最低价" dataframe:"ol"` COL bool `name:"是否周期内最低价" dataframe:"col"` OLN int `name:"最低价周期" dataframe:"oln"` OHV float64 `name:"最高价量" dataframe:"ohv"` OHBL float64 `name:"最高价量比" dataframe:"ohbl"` OLV float64 `name:"最低价量" dataframe:"olv"` OLBL float64 `name:"最低价量比" dataframe:"olbl"` UpdateTime string `name:"更新时间" dataframe:"update_time"` // 更新时间 State uint64 `name:"样本状态" dataframe:"样本状态"` // 样本状态 }
InvestmentSentimentMaster 情绪大师
func GetL5InvestmentSentimentMaster ¶ added in v1.7.5
func GetL5InvestmentSentimentMaster(securityCode string, date ...string) (ism *InvestmentSentimentMaster)
GetL5InvestmentSentimentMaster 获取情绪大师的数据
func NewInvestmentSentimentMaster ¶ added in v1.7.5
func NewInvestmentSentimentMaster(date, code string) *InvestmentSentimentMaster
func (*InvestmentSentimentMaster) Factory ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) Factory(date string, code string) Feature
func (*InvestmentSentimentMaster) FromHistory ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) FromHistory(history History) Feature
func (*InvestmentSentimentMaster) GetDate ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) GetDate() string
func (*InvestmentSentimentMaster) GetSecurityCode ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) GetSecurityCode() string
func (*InvestmentSentimentMaster) Increase ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) Increase(snapshot QuoteSnapshot) Feature
func (*InvestmentSentimentMaster) Init ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) Init(ctx context.Context, date string) error
func (*InvestmentSentimentMaster) Repair ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) Repair(securityCode, cacheDate, featureDate string, whole bool)
func (*InvestmentSentimentMaster) Update ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) Update(code, cacheDate, featureDate string, whole bool)
func (*InvestmentSentimentMaster) ValidateSample ¶ added in v1.7.5
func (this *InvestmentSentimentMaster) ValidateSample() error
type JuXianDongXiang ¶ added in v0.8.8
type KLineBox ¶ added in v0.8.8
type KLineBox struct { Code string // 证券代码 Date string // 数据日期 DoubletPeriod int // box: 倍量周期 DoubleHigh float64 // box: 倍量最高 DoubleLow float64 // box: 倍量最低 Buy bool // box: 买入 HalfPeriod int // box: 半量周期 HalfHigh float64 // box: 半量最高 HalfLow float64 // box: 半量最低 Sell bool // box: 卖出 TendencyPeriod int // box: 趋势周期 QSFZ bool // qsfz: 信号 QSCP float64 // qsfz: cp QSCV float64 // qsfz: cv QSVP float64 // qsfz: vp QSVP3 float64 // qsfz: vp3 QSVP5 float64 // qsfz: vp5 DkCol float64 // dkqs: 能量柱, 通达信分时指标DkCol DkD float64 // dkqs: 多头力量 DkK float64 // dkqs: 空头力量 DkB bool // dkqs: 买入 DkS bool // dkqs: 卖出 DxDivergence float64 // madx: 综合发散度评估值 DxDm0 float64 // madx: 均线发散度-超短线 DxDm1 float64 // madx: 均线发散度-短线 DxDm2 float64 // madx: 均线发散度-中线 DxB bool // madx: 买入 }
KLineBox 有效突破(BreaksThrough)平台
func NewKLineBox ¶ added in v0.8.8
NewKLineBox 构建有效突破数据
type Manifest ¶ added in v0.3.5
type Manifest struct { cache.DataSummary Date string Code string }
func (Manifest) GetSecurityCode ¶ added in v0.3.5
type Misc ¶ added in v1.1.3
type Misc struct { cache.DataSummary `dataframe:"-"` Date string `name:"日期" dataframe:"日期"` // 数据日期 Code string `name:"证券代码" dataframe:"证券代码"` // 证券代码 Shape uint64 `name:"K线形态" dataframe:"K线形态"` // K线形态 MV3 float64 `name:"前3日分钟均量" dataframe:"前3日分钟均量"` // 前3日分钟均量 MA3 float64 `name:"3日均线" dataframe:"3日均线"` // 3日均价 MV5 float64 `name:"前5日分钟均量" dataframe:"前5日分钟均量"` // 前5日每分钟均量, 量比(QuantityRelativeRatio)需要 MA5 float64 `name:"5日均线" dataframe:"5日均线"` // 5日均价 MA10 float64 `name:"10日均线" dataframe:"10日均线"` // 10日均价 MA20 float64 `name:"20日均线" dataframe:"20日均线"` // 生命线(MA20)/20日线 FundFlow float64 `name:"资金流向" dataframe:"资金流向"` // 资金流向, 暂时无用 RZYEZB float64 `name:"融资余额占流通市值比(%)" dataframe:"RZYEZB"` // 融资余额占流通市值比 VolumeRatio float64 `name:"成交量比" dataframe:"成交量比"` // 成交量放大比例, 相邻的两个交易日进行比对 TurnoverRate float64 `name:"换手率" dataframe:"换手率"` // 换手率 AmplitudeRatio float64 `name:"振幅" dataframe:"振幅"` // 振幅 BidOpen float64 `name:"竞价开盘" dataframe:"竞价开盘"` // 竞价开盘价 BidClose float64 `name:"竞价结束" dataframe:"竞价结束"` // 竞价结束 BidHigh float64 `name:"竞价最高" dataframe:"竞价最高"` // 竞价最高 BidLow float64 `name:"竞价最低" dataframe:"竞价最低"` // 竞价最低 BidMatched float64 `name:"竞价匹配量" dataframe:"竞价匹配量"` // 竞价匹配量 BidUnmatched float64 `name:"竞价未匹配" dataframe:"竞价未匹配"` // 竞价未匹配量 BidDirection int `name:"竞价方向" dataframe:"竞价方向"` // 竞价方向 OpenBiddingDirection int `name:"开盘竞价" dataframe:"开盘竞价"` // 竞价方向, 交易当日集合竞价开盘时更新 OpenVolumeDirection int `name:"开盘竞量" dataframe:"开盘竞量"` // 委托量差, 交易当日集合竞价开盘时更新 CloseBiddingDirection int `name:"收盘竞价" dataframe:"收盘竞价"` // 竞价方向, 交易当日集合竞价收盘时更新 CloseVolumeDirection int `name:"收盘竞量" dataframe:"收盘竞量"` // 委托量差, 交易当日集合竞价收盘时更新 OpenVolume int64 `name:"开盘量" dataframe:"开盘量"` // 开盘量 OpenTurnZ float64 `name:"开盘换手z" dataframe:"开盘换手z"` // 开盘换手z CloseVolume int64 `name:"收盘量" dataframe:"收盘量"` // TODO:快照数据实际上有好几条, 应该用当日成交记录修订 CloseTurnZ float64 `name:"收盘换手z" dataframe:"收盘换手z"` // 收盘换手z LastSentiment float64 `name:"昨日情绪" dataframe:"昨日情绪"` // 昨日情绪 LastConsistent int `name:"昨日情绪一致" dataframe:"昨日情绪一致"` // 昨日情绪一致 OpenSentiment float64 `name:"开盘情绪值" dataframe:"开盘情绪值"` // 开盘情绪值, 个股没有 OpenConsistent int `name:"开盘情绪一致" dataframe:"开盘情绪一致"` // 开盘情绪一致, 个股没有 CloseSentiment float64 `name:"收盘情绪值" dataframe:"收盘情绪值"` // 收盘情绪值 CloseConsistent int `name:"收盘情绪一致" dataframe:"收盘情绪一致"` // 收盘情绪一致 AveragePrice float64 `name:"均价线" dataframe:"均价线"` // 均价线 Volume int64 `name:"成交量" dataframe:"成交量"` // 成交量 InnerVolume int64 `name:"内盘" dataframe:"内盘"` // 内盘 OuterVolume int64 `name:"外盘" dataframe:"外盘"` // 外盘 InnerAmount float64 `name:"卖出金额" dataframe:"inner_amount"` // 卖出金额合计 OuterAmount float64 `name:"买入金额" dataframe:"outer_amount"` // 买入金额合计 Change5 float64 `name:"5日涨幅" dataframe:"5日涨幅"` // 5日涨幅 Change10 float64 `name:"10日涨幅" dataframe:"10日涨幅"` // 10日涨幅 InitialPrice float64 `name:"启动价格" dataframe:"启动价格"` // 短线底部(Short-Term Bottom),股价最近一次上穿5日均线 ShortIntensity float64 `name:"短线强度" dataframe:"短线强度"` // 短线强度,Strength ShortIntensityDiff float64 `name:"短线强度增幅" dataframe:"短线强度增幅"` // 短线强度 MediumIntensity float64 `name:"中线强度" dataframe:"中线强度"` // 中线强度 MediumIntensityDiff float64 `name:"中线强度增幅" dataframe:"中线强度增幅"` // 中线强度 Vix float64 `name:"波动率" dataframe:"波动率"` // 波动率 BullPower float64 `name:"多方强度" dataframe:"多方强度"` // 多方强度 BearPower float64 `name:"空方强度" dataframe:"空方强度"` // 空方强度 PowerTrendReversal int `name:"多空反转" dataframe:"多空反转"` // 多空反转 PowerTrendPeriod int `name:"多空趋势周期" dataframe:"多空趋势周期"` // 多空趋势周期 State uint64 `name:"样本状态" dataframe:"样本状态"` // 样本状态 }
Misc 上一个交易日的数据快照
func (*Misc) FromHistory ¶ added in v1.1.3
func (*Misc) GetSecurityCode ¶ added in v1.1.3
func (*Misc) Increase ¶ added in v1.1.3
func (this *Misc) Increase(snapshot QuoteSnapshot) Feature
func (*Misc) ValidateSample ¶ added in v1.1.3
ValidateSample 验证样本数据
type MiscKLine ¶ added in v1.4.8
type MiscKLine struct { Date string // 日期 Code string // 证券代码 Shape uint64 // K线形态 MV3 float64 // 3日均量 MA3 float64 // 3日均价 MV5 float64 // 5日均量 MA5 float64 // 5日均价 MA10 float64 // 10日均价 MA20 float64 // 20日均价 VolumeRatio float64 // 成交量比 TurnoverRate float64 // 换手率 AmplitudeRatio float64 // 振幅 AveragePrice float64 // 均价线 Change5 float64 // 5日涨幅 Change10 float64 // 10日涨幅 InitialPrice float64 // 短线底部(Short-Term Bottom),股价最近一次上串5日均线 ShortIntensity float64 // 短线强度 ShortIntensityDiff float64 // 短线强度增幅 MediumIntensity float64 // 中线强度 MediumIntensityDiff float64 // 中线强度增幅 Vix float64 // 波动率 Sentiment float64 // 情绪值 Consistent int // 情绪一致 }
MiscKLine K线特征
func NewMiscKLine ¶ added in v1.4.8
NewMiscKLine 构建制定日期的K线数据
type MovingAverage ¶ added in v0.8.8
MovingAverage 移动平均线(MA)
type PowerTrend ¶ added in v1.5.0
type PowerTrend = int
const ( // SignalNegative indicates that a particular value is a negative peak. SignalNegative PowerTrend = -1 // SignalNeutral indicates that a particular value is not a peak. SignalNeutral PowerTrend = 0 // SignalPositive indicates that a particular value is a positive peak. SignalPositive PowerTrend = 1 )
type QuShiFanZhuan ¶ added in v0.8.8
type QuShiFanZhuan struct { QSFZ bool // 反转信号 CP float64 // 股价涨幅 CV float64 // 成交量涨幅 VP float64 // 价量比 VP3 float64 // 3日价量比 VP5 float64 // 5日价量比 }
QuShiFanZhuan 趋势反转
type QuoteSnapshot ¶ added in v0.8.5
type QuoteSnapshot struct { Date string // 交易日期 ServerTime string // 时间 SecurityCode string // 证券代码 ExchangeState quotes.ExchangeState // 交易状态 State quotes.TradeState // 上市公司状态 Market uint8 // 市场ID Code string `name:"证券代码"` // 代码 Name string `name:"证券名称"` // 证券名称 Active uint16 `name:"活跃度"` // 活跃度 LastClose float64 `name:"昨收"` // 昨收 Open float64 `name:"开盘价"` // 开盘 OpeningChangeRate float64 `name:"开盘涨幅%"` // 开盘 Price float64 `name:"现价"` // 现价 ChangeRate float64 `name:"涨跌幅%"` // 涨跌幅 PremiumRate float64 `name:"溢价率%"` // 集合竞价买入溢价, hedgeRatio High float64 // 最高 Low float64 // 最低 Vol int // 总量 CurVol int // 现量 Amount float64 // 总金额 SVol int // 内盘 BVol int // 外盘 IndexOpenAmount int // 指数-集合竞价成交金额=开盘成交金额 StockOpenAmount int // 个股-集合竞价成交金额=开盘成交金额 OpenVolume int `name:"开盘量"` // 集合竞价-开盘量, 单位是股 CloseVolume int `name:"收盘量"` /// 集合竞价-收盘量, 单位是股 IndexUp int // 指数有效-上涨数 IndexUpLimit int // 指数有效-涨停数 IndexDown int // 指数有效-下跌数 IndexDownLimit int // 指数有效-跌停数 OpenBiddingDirection int `name:"开盘竞价" dataframe:"开盘竞价"` // 竞价方向, 交易当日集合竞价开盘时更新 OpenVolumeDirection int `name:"开盘竞量" dataframe:"开盘竞量"` // 委托量差, 交易当日集合竞价开盘时更新 CloseBiddingDirection int `name:"收盘竞价" dataframe:"收盘竞价"` // 竞价方向, 交易当日集合竞价收盘时更新 CloseVolumeDirection int `name:"收盘竞量" dataframe:"收盘竞量"` // 委托量差, 交易当日集合竞价收盘时更新 Rate float64 // 涨速 TopNo int // 板块排名 TopCode string // 领涨个股 TopName string // 领涨个股名称 TopRate float64 // 领涨个股涨幅 ZhanTing int // 涨停数 Ling int // 平盘数 Count int // 总数 Capital float64 `name:"流通盘"` // 流通盘 FreeCapital float64 `name:"自由流通股本"` // 自由流通股本 OpenTurnZ float64 `name:"开盘换手Z%"` // 开盘换手 OpenQuantityRatio float64 `name:"开盘量比"` QuantityRatio float64 `name:"量比"` ChangePower float64 `name:"涨跌力度"` // 开盘金额除以开盘涨幅 AverageBiddingVolume int `name:"委托均量"` // 委托均量 NextOpen float64 // 仅回测有效: 下一个交易日开盘价 NextClose float64 // 仅回测有效: 下一个交易日收盘价 NextHigh float64 // 仅回测有效: 下一个交易日最高价 NextLow float64 // 仅回测有效: 下一个交易日最低价 UpdateTime string // 本地时间戳 }
QuoteSnapshot 即时行情快照
func (QuoteSnapshot) ExistDownwardGap ¶ added in v1.7.1
func (q QuoteSnapshot) ExistDownwardGap() bool
ExistDownwardGap 是否存在向下跳空缺口
func (QuoteSnapshot) ExistUpwardGap ¶ added in v1.7.1
func (q QuoteSnapshot) ExistUpwardGap() bool
ExistUpwardGap 是否存在向上跳空缺口
type SecurityFeature ¶ added in v1.1.4
type SecurityFeature struct { Date string `name:"日期" dataframe:"date,string"` Open float64 `name:"开盘" dataframe:"open,float64"` Close float64 `name:"收盘" dataframe:"close,float64"` High float64 `name:"最高" dataframe:"high,float64"` Low float64 `name:"最低" dataframe:"low,float64"` Volume int64 `name:"成交量" dataframe:"volume,int64"` Amount float64 `name:"成交额" dataframe:"amount,float64"` Up int `name:"上涨家数" dataframe:"up,int64"` // 个股无效 Down int `name:"下跌家数" dataframe:"down,int64"` // 个股无效 LastClose float64 `name:"昨收" dataframe:"last_close,float64"` ChangeRate float64 `name:"涨跌幅" dataframe:"change_rate,float64"` OpenVolume int64 `name:"开盘量" dataframe:"open_volume,int64"` OpenTurnZ float64 `name:"开盘换手z" dataframe:"open_turnz,float64"` OpenUnmatched int64 `name:"开盘未匹配" dataframe:"open_unmatched,int64"` // K线无效, 调取misc特征数据获取 CloseVolume int64 `name:"收盘量" dataframe:"close_volume,int64"` CloseTurnZ float64 `name:"收盘换手z" dataframe:"close_turnz,float64"` CloseUnmatched int64 `name:"收盘未匹配" dataframe:"close_unmatched,int64"` // K线无效, 调取misc特征数据获取 InnerVolume int64 `name:"内盘" dataframe:"inner_volume,int64"` OuterVolume int64 `name:"外盘" dataframe:"outer_volume,int64"` InnerAmount float64 `name:"流出金额" dataframe:"inner_amount,float64"` OuterAmount float64 `name:"流入金额" dataframe:"outer_amount,float64"` }
SecurityFeature 证券特征信息
func CheckoutWideTableByDate ¶ added in v1.3.1
func CheckoutWideTableByDate(code, date string) []SecurityFeature
CheckoutWideTableByDate 捡出指定日期的K线数据
TODO: 扩展数据不适用内存缓存, 减小内存压力
func (SecurityFeature) CheckSum ¶ added in v1.6.4
func (this SecurityFeature) CheckSum() int
CheckSum 校验和
type ShapeType ¶ added in v0.8.8
type ShapeType = uint64
ShapeType K线形态类型
const ( KLineShapeYiZi ShapeType = 1 << iota // 1一字 KLineShapeLimitUp // 2涨停板 KLineShapeLimitDown // 3跌停板 KLineShapeNoChanged // 4平盘 KLineShapeUp // 5上涨 KLineShapeDown // 6下跌 KLineShapeDoji // 7十字星 KLineShapeLongUpShadow // 8长上影线 KLineShapeLongDownShadow // 9长下影线 KLineShapeDaYangLine // 10大阳线 KLineShapeDaYinLine // 11大阴线 KLineShapeZhongYangLine // 12中阳线 KLineShapeZhongYinLine // 13中阴线 KLineShapeXiaoYangLine // 14小阳线 KLineShapeXiaoYinLine // 15小阴线 KLineShapeNotLimitUp // 16炸板, 曾涨停 KLineShapeNotLimitDown // 17曾跌停 KLineShapeShrinkToHalf // 18第3日缩量到一半 KLineShapeGrabChipInFinalRound // 19尾盘抢筹 KLineShapeChant // 20吟唱, 蓄力 配合大阳线 KLineShapeStepBackDailyMA // 21日线-连续2个周期回踩均线 KLineShapeStepBackWeeklyMA // 22周线-连续2个周期回踩均线 KLineShapeStepBackMonthlyMA // 23月线-连续2个周期回踩均线 )
type Trait ¶ added in v0.3.7
type Trait interface { // FromHistory 从历史数据加载 FromHistory(history History) Feature // Increase 增量计算 // 用快照增量计算特征 Increase(snapshot QuoteSnapshot) Feature // ValidateSample 验证样本 ValidateSample() error }
Trait 基础的特性
这也是一个特征, 为啥起这个名字, 自己可以脑补 哈哈~
type TransactionRecord ¶ added in v0.8.8
type TransactionRecord struct { cache.DataSummary Date string Code string }
TransactionRecord 成交记录
最短3秒内的合并统计数据, 与行情数据保持一致 不可以当作tick数据来使用
func (*TransactionRecord) Check ¶ added in v0.8.8
func (r *TransactionRecord) Check(cacheDate, featureDate string) error
func (*TransactionRecord) Checkout ¶ added in v0.8.8
func (r *TransactionRecord) Checkout(securityCode, date string)
func (*TransactionRecord) Clone ¶ added in v0.8.8
func (r *TransactionRecord) Clone(date string, code string) DataSet
func (*TransactionRecord) Filename ¶ added in v0.8.8
func (r *TransactionRecord) Filename(date, code string) string
func (*TransactionRecord) GetDate ¶ added in v0.8.8
func (r *TransactionRecord) GetDate() string
func (*TransactionRecord) GetSecurityCode ¶ added in v0.8.8
func (r *TransactionRecord) GetSecurityCode() string
func (*TransactionRecord) Increase ¶ added in v0.8.8
func (r *TransactionRecord) Increase(snapshot quotes.Snapshot)
func (*TransactionRecord) Init ¶ added in v0.8.8
func (r *TransactionRecord) Init(ctx context.Context, date string) error
func (*TransactionRecord) Print ¶ added in v0.8.8
func (r *TransactionRecord) Print(code string, date ...string)
func (*TransactionRecord) Repair ¶ added in v0.8.8
func (r *TransactionRecord) Repair(date string)
func (*TransactionRecord) Update ¶ added in v0.8.8
func (r *TransactionRecord) Update(date string)
type TurnoverDataSummary ¶ added in v1.1.4
type TurnoverDataSummary struct { OpenVolume int64 `name:"开盘量" dataframe:"open_volume,int64"` OpenTurnZ float64 `name:"开盘换手z" dataframe:"open_turnz,float64"` OpenUnmatched int64 `name:"开盘未匹配" dataframe:"open_unmatched,int64"` // K线无效, 调取misc特征数据获取 CloseVolume int64 `name:"收盘量" dataframe:"close_volume,int64"` CloseTurnZ float64 `name:"收盘换手z" dataframe:"close_turnz,float64"` CloseUnmatched int64 `name:"收盘未匹配" dataframe:"close_unmatched,int64"` // K线无效, 调取misc特征数据获取 InnerVolume int64 `name:"内盘" dataframe:"inner_volume,int64"` OuterVolume int64 `name:"外盘" dataframe:"outer_volume,int64"` InnerAmount float64 `name:"流出金额" dataframe:"inner_amount,float64"` OuterAmount float64 `name:"流入金额" dataframe:"outer_amount,float64"` }
TurnoverDataSummary 换手数据概要
func CountInflow ¶ added in v0.8.8
func CountInflow(list []quotes.TickTransaction, securityCode string, date string) (summary TurnoverDataSummary)
CountInflow 统计指定日期的内外盘
Source Files ¶
- adapter.go
- cache1d.go
- dataset.go
- dataset_features.go
- dataset_kline.go
- dataset_minutes.go
- dataset_report.go
- dataset_report_preview.go
- dataset_safetyscore.go
- dataset_trans.go
- dataset_trans_count.go
- dataset_wide.go
- dataset_wide_old.go
- dataset_wide_rotation.go
- dataset_xdxr.go
- doc.go
- feature.go
- feature_aggregation.go
- feature_box.go
- feature_box_breaks.go
- feature_box_dkqs.go
- feature_box_madx.go
- feature_box_qsfz.go
- feature_f10.go
- feature_f10_base.go
- feature_f10_capital.go
- feature_f10_notice.go
- feature_f10_reports.go
- feature_f10_shareholder.go
- feature_f10_subnew.go
- feature_f10_utils.go
- feature_history.go
- feature_ism.go
- feature_misc.go
- feature_misc_base.go
- feature_misc_kline_shape.go
- feature_misc_rzrq.go
- feature_no1.go
- feature_utils.go
- kline.go
- quote_snapshot.go