2 Star 11 Fork 13

王布衣/engine

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
cache_xdxr.go 1.49 KB
Copy Edit Raw Blame History
王布衣 authored 2023-10-24 07:53 +08:00 . 增加分时数据缓存
package datasets
import (
"context"
"gitee.com/quant1x/engine/cache"
"gitee.com/quant1x/engine/datasets/base"
"gitee.com/quant1x/gotdx/quotes"
)
// DataXdxr 除权除息
type DataXdxr struct {
cache.DataSummary
Date string
Code string
}
func init() {
summary := mapDataSets[BaseXdxr]
_ = cache.Register(&DataXdxr{DataSummary: summary})
}
func (x *DataXdxr) Clone(date string, code string) DataSet {
summary := mapDataSets[BaseXdxr]
var dest = DataXdxr{DataSummary: summary, Date: date, Code: code}
return &dest
}
func (x *DataXdxr) GetDate() string {
return x.Date
}
func (x *DataXdxr) GetSecurityCode() string {
return x.Code
}
func (x *DataXdxr) Init(ctx context.Context, date string) error {
_ = ctx
_ = date
return nil
}
// func (x *DataXdxr) Checkout(securityCode, date string) {
// //TODO implement me
// panic("implement me")
// }
//
// func (x *DataXdxr) Check(cacheDate, featureDate string) error {
// //TODO implement me
// panic("implement me")
// }
func (x *DataXdxr) Print(code string, date ...string) {
//TODO implement me
panic("implement me")
}
func (x *DataXdxr) Filename(date, code string) string {
//TODO implement me
_ = code
_ = date
panic("implement me")
}
func (x *DataXdxr) Update(date string) {
base.UpdateXdxrInfo(x.GetSecurityCode())
_ = date
}
func (x *DataXdxr) Repair(date string) {
base.UpdateXdxrInfo(x.GetSecurityCode())
_ = date
}
func (x *DataXdxr) Increase(snapshot quotes.Snapshot) {
// 除权除息没有增量计算的逻辑
_ = snapshot
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v0.6.5

Search