gitee.com/quant1x/engine@v1.8.4/factors/dataset_xdxr.go (about) 1 package factors 2 3 import ( 4 "context" 5 "gitee.com/quant1x/engine/cache" 6 "gitee.com/quant1x/engine/datasource/base" 7 "gitee.com/quant1x/gotdx/quotes" 8 ) 9 10 // DataXdxr 除权除息 11 type DataXdxr struct { 12 cache.DataSummary 13 Date string 14 Code string 15 } 16 17 func init() { 18 summary := __mapDataSets[BaseXdxr] 19 _ = cache.Register(&DataXdxr{DataSummary: summary}) 20 } 21 22 func (x *DataXdxr) Clone(date string, code string) DataSet { 23 summary := __mapDataSets[BaseXdxr] 24 var dest = DataXdxr{DataSummary: summary, Date: date, Code: code} 25 return &dest 26 } 27 28 func (x *DataXdxr) GetDate() string { 29 return x.Date 30 } 31 32 func (x *DataXdxr) GetSecurityCode() string { 33 return x.Code 34 } 35 36 func (x *DataXdxr) Init(ctx context.Context, date string) error { 37 _ = ctx 38 _ = date 39 return nil 40 } 41 42 // func (x *DataXdxr) Checkout(securityCode, date string) { 43 // //TODO implement me 44 // panic("implement me") 45 // } 46 // 47 // func (x *DataXdxr) Check(cacheDate, featureDate string) error { 48 // //TODO implement me 49 // panic("implement me") 50 // } 51 52 func (x *DataXdxr) Print(code string, date ...string) { 53 //TODO implement me 54 panic("implement me") 55 } 56 57 func (x *DataXdxr) Filename(date, code string) string { 58 //TODO implement me 59 _ = code 60 _ = date 61 panic("implement me") 62 } 63 64 func (x *DataXdxr) Update(date string) { 65 base.UpdateXdxrInfo(x.GetSecurityCode()) 66 _ = date 67 } 68 69 func (x *DataXdxr) Repair(date string) { 70 base.UpdateXdxrInfo(x.GetSecurityCode()) 71 _ = date 72 } 73 74 func (x *DataXdxr) Increase(snapshot quotes.Snapshot) { 75 // 除权除息没有增量计算的逻辑 76 _ = snapshot 77 }