gitee.com/quant1x/engine@v1.8.4/factors/dataset_trans.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  // TransactionRecord 成交记录
    11  //
    12  //	最短3秒内的合并统计数据, 与行情数据保持一致
    13  //	不可以当作tick数据来使用
    14  type TransactionRecord struct {
    15  	cache.DataSummary
    16  	Date string
    17  	Code string
    18  }
    19  
    20  func init() {
    21  	summary := __mapDataSets[BaseTransaction]
    22  	_ = cache.Register(&TransactionRecord{DataSummary: summary})
    23  }
    24  
    25  func (r *TransactionRecord) Clone(date string, code string) DataSet {
    26  	summary := __mapDataSets[BaseTransaction]
    27  	var dest = TransactionRecord{DataSummary: summary, Date: date, Code: code}
    28  	return &dest
    29  }
    30  
    31  func (r *TransactionRecord) GetDate() string {
    32  	return r.Date
    33  }
    34  
    35  func (r *TransactionRecord) GetSecurityCode() string {
    36  	return r.Code
    37  }
    38  
    39  func (r *TransactionRecord) Print(code string, date ...string) {
    40  	//TODO implement me
    41  	panic("implement me")
    42  }
    43  
    44  func (r *TransactionRecord) Init(ctx context.Context, date string) error {
    45  	_ = ctx
    46  	_ = date
    47  	return nil
    48  }
    49  
    50  func (r *TransactionRecord) Checkout(securityCode, date string) {
    51  	//TODO implement me
    52  	panic("implement me")
    53  }
    54  
    55  func (r *TransactionRecord) Check(cacheDate, featureDate string) error {
    56  	//TODO implement me
    57  	panic("implement me")
    58  }
    59  
    60  func (r *TransactionRecord) Filename(date, code string) string {
    61  	//TODO implement me
    62  	panic("implement me")
    63  }
    64  
    65  func (r *TransactionRecord) Update(date string) {
    66  	base.UpdateBeginDateOfHistoricalTradingData(date)
    67  	base.GetAllHistoricalTradingData(r.GetSecurityCode())
    68  }
    69  
    70  func (r *TransactionRecord) Repair(date string) {
    71  	//base.GetAllHistoricalTradingData(r.code)
    72  	base.GetHistoricalTradingDataByDate(r.GetSecurityCode(), date)
    73  }
    74  
    75  func (r *TransactionRecord) Increase(snapshot quotes.Snapshot) {
    76  	_ = snapshot
    77  }