datasets

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
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) // 基础数据-安全分
	BaseKLineWide           = cache.PluginMaskBaseData | (baseKind + 7) // 基础数据-宽表
	BasePerformanceForecast = cache.PluginMaskBaseData | (baseKind + 8) // 基础数据-业绩预告

)

Variables

View Source
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"}
	//FBarsOldWideFields  = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "last_close", "turnover_rate", "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"}
)

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 GetCacheKLine added in v0.5.4

func GetCacheKLine(code string, adjust ...bool) pandas.DataFrame

GetCacheKLine 加载K线

第2个参数, 是否前复权

func GetDataDescript added in v0.2.0

func GetDataDescript(kind cache.Kind) cache.DataSummary

func GetKLineAll added in v0.5.4

func GetKLineAll(securityCode string, argv ...int) pandas.DataFrame

GetKLineAll 获取日K线

func IntegrateQuarterlyReports added in v0.1.5

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

IntegrateQuarterlyReports 更新季报数据

func KLine added in v0.5.4

func KLine(securityCode string) pandas.DataFrame

KLine 加载日K线宽表

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 SetKLineOffset added in v0.5.4

func SetKLineOffset(days int)

SetKLineOffset 设置K线数据调整回补天数

func WeeklyKLine added in v0.1.5

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

WeeklyKLine 周线

Types

type DataKLine

type DataKLine struct {
	cache.DataSummary
	Date string
	Code string
}

func (*DataKLine) Check added in v0.2.3

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

func (*DataKLine) Checkout added in v0.3.2

func (k *DataKLine) Checkout(securityCode, date 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) GetDate added in v0.3.4

func (k *DataKLine) GetDate() string

func (*DataKLine) GetSecurityCode added in v0.3.4

func (k *DataKLine) GetSecurityCode() string

func (*DataKLine) Increase

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

func (*DataKLine) Init added in v0.1.5

func (k *DataKLine) Init(ctx context.Context, date string) error

func (*DataKLine) Print added in v0.2.0

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

func (*DataKLine) Repair

func (k *DataKLine) Repair(date string)

func (*DataKLine) Update

func (k *DataKLine) Update(date string)

type DataMinutes added in v0.5.3

type DataMinutes struct {
	Manifest
}

DataMinutes 分时数据

func (*DataMinutes) Clone added in v0.5.3

func (this *DataMinutes) Clone(date string, code string) DataSet

func (*DataMinutes) Increase added in v0.5.3

func (this *DataMinutes) Increase(snapshot quotes.Snapshot)

func (*DataMinutes) Init added in v0.5.3

func (this *DataMinutes) Init(ctx context.Context, date string) error

func (*DataMinutes) Print added in v0.5.3

func (this *DataMinutes) Print(code string, date ...string)

func (*DataMinutes) Repair added in v0.5.3

func (this *DataMinutes) Repair(date string)

func (*DataMinutes) Update added in v0.5.3

func (this *DataMinutes) Update(date string)

type DataPreviewReport added in v0.6.2

type DataPreviewReport struct {
	Manifest
}

DataPreviewReport 业绩预告(Listed Companies'Performance Forecast)

func (*DataPreviewReport) Clone added in v0.6.2

func (this *DataPreviewReport) Clone(date string, code string) DataSet

func (*DataPreviewReport) Increase added in v0.6.2

func (this *DataPreviewReport) Increase(snapshot quotes.Snapshot)

func (*DataPreviewReport) Init added in v0.6.2

func (this *DataPreviewReport) Init(ctx context.Context, date string) error

func (*DataPreviewReport) Print added in v0.6.2

func (this *DataPreviewReport) Print(code string, date ...string)

func (*DataPreviewReport) Repair added in v0.6.2

func (this *DataPreviewReport) Repair(date string)

func (*DataPreviewReport) Update added in v0.6.2

func (this *DataPreviewReport) Update(date string)

type DataQuarterlyReport added in v0.1.5

type DataQuarterlyReport struct {
	cache.DataSummary
	Date string
	Code string
	// contains filtered or unexported fields
}

DataQuarterlyReport 季报

func (*DataQuarterlyReport) Check added in v0.2.3

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

func (*DataQuarterlyReport) Checkout added in v0.3.2

func (r *DataQuarterlyReport) Checkout(securityCode, date 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) GetDate added in v0.3.4

func (r *DataQuarterlyReport) GetDate() string

func (*DataQuarterlyReport) GetSecurityCode added in v0.3.4

func (r *DataQuarterlyReport) GetSecurityCode() 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(ctx context.Context, date string) error

func (*DataQuarterlyReport) Print added in v0.2.0

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

func (*DataQuarterlyReport) Repair added in v0.1.5

func (r *DataQuarterlyReport) Repair(date string)

func (*DataQuarterlyReport) Update added in v0.1.5

func (r *DataQuarterlyReport) Update(date string)

type DataSafetyScore deprecated added in v0.1.5

type DataSafetyScore struct {
	cache.DataSummary
}

DataSafetyScore 个股基本面安全评分

Deprecated: 废弃

type DataSet

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 DataWide added in v0.5.4

type DataWide struct {
	Manifest
}

func (*DataWide) Clone added in v0.5.4

func (this *DataWide) Clone(date string, code string) DataSet

func (*DataWide) Increase added in v0.5.4

func (this *DataWide) Increase(snapshot quotes.Snapshot)

func (*DataWide) Init added in v0.5.4

func (this *DataWide) Init(ctx context.Context, date string) error

func (*DataWide) Print added in v0.5.4

func (this *DataWide) Print(code string, date ...string)

func (*DataWide) Repair added in v0.5.4

func (this *DataWide) Repair(date string)

func (*DataWide) Update added in v0.5.4

func (this *DataWide) Update(date string)

type DataXdxr

type DataXdxr struct {
	cache.DataSummary
	Date string
	Code string
}

DataXdxr 除权除息

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) GetDate added in v0.3.4

func (x *DataXdxr) GetDate() string

func (*DataXdxr) GetSecurityCode added in v0.3.4

func (x *DataXdxr) GetSecurityCode() string

func (*DataXdxr) Increase

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

func (*DataXdxr) Init added in v0.1.5

func (x *DataXdxr) Init(ctx context.Context, date string) error

func (*DataXdxr) Print added in v0.2.0

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

func (*DataXdxr) Repair

func (x *DataXdxr) Repair(date string)

func (*DataXdxr) Update

func (x *DataXdxr) Update(date string)

type Manifest added in v0.3.5

type Manifest struct {
	cache.DataSummary
	Date string
	Code string
}

func (Manifest) GetDate added in v0.3.5

func (m Manifest) GetDate() string

func (Manifest) GetSecurityCode added in v0.3.5

func (m Manifest) GetSecurityCode() 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 {
	cache.DataSummary
	Date string
	Code string
}

TransactionRecord 成交记录

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

func (*TransactionRecord) Check added in v0.2.3

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

func (*TransactionRecord) Checkout added in v0.3.2

func (r *TransactionRecord) Checkout(securityCode, date 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) GetDate added in v0.3.4

func (r *TransactionRecord) GetDate() string

func (*TransactionRecord) GetSecurityCode added in v0.3.4

func (r *TransactionRecord) GetSecurityCode() 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(ctx context.Context, date string) error

func (*TransactionRecord) Print added in v0.2.0

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

func (*TransactionRecord) Repair added in v0.2.0

func (r *TransactionRecord) Repair(date string)

func (*TransactionRecord) Update added in v0.2.0

func (r *TransactionRecord) Update(date string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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