datasets

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicKLine added in v0.1.5

func BasicKLine(securityCode string) pandas.DataFrame

BasicKLine 基础日K线

func CountInflow added in v0.2.0

func CountInflow(list []quotes.TickTransaction, securityCode string, date string) (summary cache.TurnoverDataSummary)

CountInflow 统计指定日期的内外盘

func IntegrateQuarterlyReports added in v0.1.5

func IntegrateQuarterlyReports(barIndex *int, date string) map[string]dfcf.QuarterlyReport

IntegrateQuarterlyReports 更新季报数据

func KLineToWeekly added in v0.1.5

func KLineToWeekly(kline pandas.DataFrame) pandas.DataFrame

KLineToWeekly 日线转周线

deprecated: 不推荐使用

func MonthlyKLine added in v0.1.5

func MonthlyKLine(securityCode string, cacheKLine ...[]base.KLine) (df pandas.DataFrame)

MonthlyKLine 月K线

func WeeklyKLine added in v0.1.5

func WeeklyKLine(securityCode string, cacheKLine ...[]base.KLine) (df pandas.DataFrame)

WeeklyKLine 周线

Types

type DataCache

type DataCache struct {
	Date string // 日期
	Code string // 证券代码
	// contains filtered or unexported fields
}

DataCache 基础的数据缓存

type DataKLine

type DataKLine struct {
	DataCache
}

func (*DataKLine) Check added in v0.2.3

func (k *DataKLine) Check(cacheDate, featureDate string)

func (*DataKLine) Clone

func (k *DataKLine) Clone(date, code string) DataSet

func (*DataKLine) Filename

func (k *DataKLine) Filename(date, code string) string

func (*DataKLine) Increase

func (k *DataKLine) Increase(snapshot quotes.Snapshot)

func (*DataKLine) Init added in v0.1.5

func (k *DataKLine) Init(barIndex *int, date string) error

func (*DataKLine) Key

func (k *DataKLine) Key() string

func (*DataKLine) Kind

func (k *DataKLine) Kind() DataKind

func (*DataKLine) Name

func (k *DataKLine) Name() string

func (*DataKLine) Print added in v0.2.0

func (k *DataKLine) Print(code string, date ...string)

func (*DataKLine) Provider added in v0.2.3

func (k *DataKLine) Provider() string

func (*DataKLine) Repair

func (k *DataKLine) Repair(cacheDate, featureDate string)

func (*DataKLine) Update

func (k *DataKLine) Update(cacheDate, featureDate string)

func (*DataKLine) Usage added in v0.2.0

func (k *DataKLine) Usage() string

type DataKind

type DataKind = uint64
const (
	BaseXdxr             DataKind = cache.PluginMaskBaseData | (baseKind + 1) // 基础数据-除权除息
	BaseKLine            DataKind = cache.PluginMaskBaseData | (baseKind + 2) // 基础数据-基础K线
	BaseTransaction      DataKind = cache.PluginMaskBaseData | (baseKind + 3) // 基础数据-历史成交
	BaseMinutes          DataKind = cache.PluginMaskBaseData | (baseKind + 4) // 基础数据-分时数据
	BaseQuarterlyReports DataKind = cache.PluginMaskBaseData | (baseKind + 5) // 基础数据-季报
	BaseSafetyScore      DataKind = cache.PluginMaskBaseData | (baseKind + 6) // 基础数据-安全分
	BaseAggregationData  DataKind = 1 << 63
	BaseTest             DataKind = 0x8000000000000000
)

type DataQuarterlyReport added in v0.1.5

type DataQuarterlyReport struct {
	DataCache
	// contains filtered or unexported fields
}

DataQuarterlyReport 季报

func (*DataQuarterlyReport) Check added in v0.2.3

func (r *DataQuarterlyReport) Check(cacheDate, featureDate string)

func (*DataQuarterlyReport) Clone added in v0.1.5

func (r *DataQuarterlyReport) Clone(date string, code string) DataSet

func (*DataQuarterlyReport) Filename added in v0.1.5

func (r *DataQuarterlyReport) Filename(date, code string) string

func (*DataQuarterlyReport) Increase added in v0.1.5

func (r *DataQuarterlyReport) Increase(snapshot quotes.Snapshot)

func (*DataQuarterlyReport) Init added in v0.1.5

func (r *DataQuarterlyReport) Init(barIndex *int, date string) error

func (*DataQuarterlyReport) Key added in v0.1.5

func (r *DataQuarterlyReport) Key() string

func (*DataQuarterlyReport) Kind added in v0.1.5

func (r *DataQuarterlyReport) Kind() DataKind

func (*DataQuarterlyReport) Name added in v0.1.5

func (r *DataQuarterlyReport) Name() string

func (*DataQuarterlyReport) Print added in v0.2.0

func (r *DataQuarterlyReport) Print(code string, date ...string)

func (*DataQuarterlyReport) Provider added in v0.2.3

func (r *DataQuarterlyReport) Provider() string

func (*DataQuarterlyReport) Repair added in v0.1.5

func (r *DataQuarterlyReport) Repair(cacheDate, featureDate string)

func (*DataQuarterlyReport) Update added in v0.1.5

func (r *DataQuarterlyReport) Update(cacheDate, featureDate string)

func (*DataQuarterlyReport) Usage added in v0.2.0

func (r *DataQuarterlyReport) Usage() string

type DataSafetyScore deprecated added in v0.1.5

type DataSafetyScore struct {
	DataCache
}

DataSafetyScore 个股基本面安全评分

Deprecated: 废弃

func (*DataSafetyScore) Clone added in v0.1.5

func (s *DataSafetyScore) Clone(date string, code string) DataSet

func (*DataSafetyScore) Filename added in v0.1.5

func (s *DataSafetyScore) Filename(date, code string) string

func (*DataSafetyScore) Increase added in v0.1.5

func (s *DataSafetyScore) Increase(snapshot quotes.Snapshot)

func (*DataSafetyScore) Init added in v0.1.5

func (s *DataSafetyScore) Init(barIndex *int, date string) error

func (*DataSafetyScore) Key added in v0.1.5

func (s *DataSafetyScore) Key() string

func (*DataSafetyScore) Kind added in v0.1.5

func (s *DataSafetyScore) Kind() DataKind

func (*DataSafetyScore) Name added in v0.1.5

func (s *DataSafetyScore) Name() string

func (*DataSafetyScore) Repair added in v0.1.5

func (s *DataSafetyScore) Repair(cacheDate, featureDate string)

func (*DataSafetyScore) Update added in v0.1.5

func (s *DataSafetyScore) Update(cacheDate, featureDate string)

type DataSet

type DataSet interface {
	Kind() DataKind                         // 类型
	Name() string                           // 特征名称
	Key() string                            // 缓存关键字
	Init(barIndex *int, date string) error  // 初始化, 加载配置信息
	Filename(date, code string) string      // 缓存文件名
	Update(cacheDate, featureDate string)   // 更新数据
	Repair(cacheDate, featureDate string)   // 回补数据
	Increase(snapshot quotes.Snapshot)      // 增量计算, 用快照增量计算特征
	Clone(date string, code string) DataSet // 克隆一个DataSet
}

DataSet 数据层, 数据集接口 smart

type DataSetSummary added in v0.2.3

type DataSetSummary struct {
	Type DataKind
	Key  string
	Name string
}

func GetDataDescript added in v0.2.0

func GetDataDescript(kind DataKind) DataSetSummary

type DataXdxr

type DataXdxr struct {
	DataCache
}

func (*DataXdxr) Check added in v0.2.3

func (x *DataXdxr) Check(cacheDate, featureDate string)

func (*DataXdxr) Clone

func (x *DataXdxr) Clone(date string, code string) DataSet

func (*DataXdxr) Filename

func (x *DataXdxr) Filename(date, code string) string

func (*DataXdxr) Increase

func (x *DataXdxr) Increase(snapshot quotes.Snapshot)

func (*DataXdxr) Init added in v0.1.5

func (x *DataXdxr) Init(barIndex *int, date string) error

func (*DataXdxr) Key

func (x *DataXdxr) Key() string

func (*DataXdxr) Kind

func (x *DataXdxr) Kind() DataKind

func (*DataXdxr) Name

func (x *DataXdxr) Name() string

func (*DataXdxr) Print added in v0.2.0

func (x *DataXdxr) Print(code string, date ...string)

func (*DataXdxr) Provider added in v0.2.3

func (x *DataXdxr) Provider() string

func (*DataXdxr) Repair

func (x *DataXdxr) Repair(cacheDate, featureDate string)

func (*DataXdxr) Update

func (x *DataXdxr) Update(cacheDate, featureDate string)

func (*DataXdxr) Usage added in v0.2.0

func (x *DataXdxr) Usage() string

type MovingAverage added in v0.1.5

type MovingAverage struct {
	MA5  float64 // 5日均线
	MA10 float64 // 10日均线
	MA20 float64 // 20日均线
}

MovingAverage 移动平均线(MA)

type TransactionRecord added in v0.2.0

type TransactionRecord struct {
	DataCache
}

TransactionRecord 成交记录

最短3秒内的合并统计数据, 与行情数据保持一致
不可以当作tick数据来使用

func (*TransactionRecord) Check added in v0.2.3

func (r *TransactionRecord) Check(cacheDate, featureDate string)

func (*TransactionRecord) Clone added in v0.2.0

func (r *TransactionRecord) Clone(date string, code string) DataSet

func (*TransactionRecord) Filename added in v0.2.0

func (r *TransactionRecord) Filename(date, code string) string

func (*TransactionRecord) Increase added in v0.2.0

func (r *TransactionRecord) Increase(snapshot quotes.Snapshot)

func (*TransactionRecord) Init added in v0.2.0

func (r *TransactionRecord) Init(barIndex *int, date string) error

func (*TransactionRecord) Key added in v0.2.0

func (r *TransactionRecord) Key() string

func (*TransactionRecord) Kind added in v0.2.0

func (r *TransactionRecord) Kind() DataKind

func (*TransactionRecord) Name added in v0.2.0

func (r *TransactionRecord) Name() string

func (*TransactionRecord) Print added in v0.2.0

func (r *TransactionRecord) Print(code string, date ...string)

func (*TransactionRecord) Provider added in v0.2.3

func (r *TransactionRecord) Provider() string

func (*TransactionRecord) Repair added in v0.2.0

func (r *TransactionRecord) Repair(cacheDate, featureDate string)

func (*TransactionRecord) Update added in v0.2.0

func (r *TransactionRecord) Update(cacheDate, featureDate string)

func (*TransactionRecord) Usage added in v0.2.0

func (r *TransactionRecord) Usage() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL