gitee.com/quant1x/engine@v1.8.4/datasource/base/tdx_zxg.go (about)

     1  package base
     2  
     3  import (
     4  	"gitee.com/quant1x/engine/cache"
     5  	"gitee.com/quant1x/exchange"
     6  	"gitee.com/quant1x/pandas"
     7  )
     8  
     9  const (
    10  	BlockPath = "/T0002/blocknew"
    11  	ZxgBlk    = "zxg.blk"
    12  	BkltBlk   = "BKLT.blk"
    13  	ZdBk      = "ZDBK.blk"
    14  )
    15  
    16  func GetZxgList() []string {
    17  	filename := cache.GetZxgFile()
    18  	df := pandas.ReadCSV(filename)
    19  	if df.Nrow() == 0 {
    20  		return []string{}
    21  	}
    22  	rows := df.Col("code")
    23  	if rows.Len() == 0 {
    24  		return []string{}
    25  	}
    26  	// 校验证券代码, 统一格式前缀加代码
    27  	cs := rows.Strings()
    28  	for i, v := range cs {
    29  		cs[i] = exchange.CorrectSecurityCode(v)
    30  	}
    31  	return cs
    32  }