datasets

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataCache

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

DataCache 基础的数据缓存

type DataKLine

type DataKLine struct {
	DataCache
}

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) Key

func (k *DataKLine) Key() string

func (*DataKLine) Kind

func (k *DataKLine) Kind() DataKind

func (*DataKLine) Name

func (k *DataKLine) Name() string

func (*DataKLine) Repair

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

func (*DataKLine) Update

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

type DataKind

type DataKind = uint64
const (
	BaseKLine       DataKind = 1 << iota // 基础数据-基础K线
	BaseTransaction                      // 基础数据-历史成交
	BaseMinutes                          // 基础数据-分时数据
	BaseXdxr                             // 基础数据-除权除息
)

type DataSet

type DataSet interface {
	Kind() DataKind                         // 类型
	Name() string                           // 特征名称
	Key() string                            // 缓存关键字
	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 DataSetCache

type DataSetCache struct {
	Type DataKind
	Key  string
	Name string
}

type DataXdxr

type DataXdxr struct {
	DataCache
}

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) Key

func (x *DataXdxr) Key() string

func (*DataXdxr) Kind

func (x *DataXdxr) Kind() DataKind

func (*DataXdxr) Name

func (x *DataXdxr) Name() string

func (*DataXdxr) Repair

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

func (*DataXdxr) Update

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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