Documentation ¶
Index ¶
- Constants
- Variables
- func BlockFilename(ns ...string) string
- func CacheId(code string) string
- func CacheIdPath(code string) string
- func CorrectDate(date string) string
- func F10Apply(update func(securityCode string, f10 *Security) (ok bool))
- func F10Length() int
- func FeatureFilename(code string) string
- func FileExist(path string) bool
- func FileIsValid(path string) bool
- func FinanceFilename(code string) string
- func FinanceInfoFilename() string
- func GetALLPath() string
- func GetBkPath() string
- func GetCache(fullCode string) *os.File
- func GetCacheAllSecurityList() pandas.DataFrame
- func GetCacheBlockList() pandas.DataFrame
- func GetCapital(securityCode string) float64
- func GetCreateTime(finfo os.FileInfo) time.Time
- func GetDayPath() string
- func GetFeaturesPath() string
- func GetFinancePath() string
- func GetFreeCapital(securityCode string) float64
- func GetInfoPath() string
- func GetKaipanVol(securityCode string) float64
- func GetLRBPath() string
- func GetSecurityList() []string
- func GetSecurityName(securityCode string) (string, bool)
- func GetSnapshotPath() string
- func GetTickFilename(code string, date string, createPath bool) string
- func GetTickPath() string
- func GetTotalCapital(securityCode string) float64
- func GetXJLLBPath() string
- func GetXdxrPath() string
- func GetZCFZBPath() string
- func GetZYZBPath() string
- func GetZxgFile() string
- func HoldingFilename() string
- func IsNeedIgnore(securityCode string) bool
- func KLineFilename(code string) string
- func LRBFilename(code string) string
- func LoadCacheSecurityList()
- func RiskAssessmentFilename() string
- func SecutiryListFilename() string
- func SentimentSnapshotFilename() string
- func SnapshotFilename(code string) string
- func TickFilename(code string, date string) string
- func TickOpenFilename() string
- func Today() string
- func UpdateF10(f10 Security)
- func UpdateSecurityName(securityCode, name string)
- func UpdateTickStartDate(date string)
- func XJLLBFilename(code string) string
- func XdxrFilename(code string) string
- func YJBBAllFilename() string
- func ZCFZBFilename(code string) string
- func ZYZBFilename(code string) string
- type CacheKaipan
- type CacheType
- type FastCache
- type Security
- type SecurityFeature
- type TurnoverDataSummary
Constants ¶
const ( DAY_PATH = "day" // 日线路径 INFO_PATH = "info" // 信息路径 TICK_PATH = "tick" // tick路径 XDXR_PATH = "xdxr" // 除权除息路径 BLOCK_PATH = "bk" // 板块数据 SNAPSHOT_PATH = "snapshot" // 快照数据路径 FEATURE_PATH = "features" // 特征路径 FINANCE_PATH = "finance" //财务信息路径 ZYZB_PATH = "zyzb" //季报的主要指标 ZCFZB_PATH = "zcfzb" //季报的资产负债表 LRB_PATH = "lrb" //季报的利润表 XJLLB_PATH = "xjllb" //季报的现金流量表 ALL_PATH = "all" //季报的所有票的汇总 YJBBAllFile = "yjbb_all" //季报汇总 )
Variables ¶
var (
// TickStartDate 最早的时间
TickStartDate = "20220101"
)
Functions ¶
func CacheIdPath ¶ added in v0.7.6
CacheIdPath code从后保留3位, 市场缩写+从头到倒数第3的代码, 确保每个目录只有000~999个代码
func CorrectDate ¶ added in v0.7.6
CorrectDate 矫正日期, 统一格式: 20060102
func FeatureFilename ¶ added in v1.2.9
FeatureFilename 特征数据缓存路径
func FinanceFilename ¶ added in v1.5.18
FinanceFilename Finance缓存路径
func FinanceInfoFilename ¶ added in v1.1.5
func FinanceInfoFilename() string
FinanceInfoFilename F10缓存路径
func GetCacheAllSecurityList ¶ added in v1.7.0
GetCacheAllSecurityList 获取A股证券基础列表
func GetCacheBlockList ¶ added in v1.7.0
GetCacheBlockList 获取板块列表
func GetCreateTime ¶ added in v1.5.6
GetCreateTime 获取文件创建时间
func GetFreeCapital ¶ added in v1.5.10
GetFreeCapital 获取自由流通股本
func GetKaipanVol ¶ added in v1.1.15
GetKaipanVol 获取开盘量
func GetSecurityName ¶ added in v1.7.0
GetSecurityName 获取证券名称
func GetTickFilename ¶ added in v1.0.0
func GetTotalCapital ¶ added in v1.5.10
GetTotalCapital 获取总股本
func IsNeedIgnore ¶ added in v1.7.0
IsNeedIgnore 需要忽略的个股
func LoadCacheSecurityList ¶ added in v1.7.0
func LoadCacheSecurityList()
LoadCacheSecurityList 加载股票列表
func RiskAssessmentFilename ¶ added in v1.5.7
func RiskAssessmentFilename() string
RiskAssessmentFilename 风险测评信息缓存路径
func SecutiryListFilename ¶ added in v1.7.0
func SecutiryListFilename() string
SecutiryListFilename 证券列表文件名
func SentimentSnapshotFilename ¶ added in v1.6.8
func SentimentSnapshotFilename() string
SentimentSnapshotFilename 情绪快照缓存路径
func SnapshotFilename ¶ added in v0.8.16
SnapshotFilename snapshot缓存路径
func TickFilename ¶ added in v0.7.4
TickFilename tick文件比较多, 目录结构${tick}/${YYYY}/${YYYYMMDD}/${CacheIdPath}
func UpdateSecurityName ¶ added in v1.7.0
func UpdateSecurityName(securityCode, name string)
UpdateSecurityName 更新证券名称
func UpdateTickStartDate ¶ added in v0.8.0
func UpdateTickStartDate(date string)
UpdateTickStartDate 修改tick数据开始下载的日期
func XJLLBFilename ¶ added in v1.5.18
XJLLBFilename 季报现金流量表缓存路径
func ZCFZBFilename ¶ added in v1.5.18
ZCFZBFilename 季报资产负债表缓存路径
Types ¶
type CacheKaipan ¶ added in v1.1.15
type CacheType ¶
type CacheType int
const ( CACHE_CSV CacheType = iota // CSV CACHE_EXCEL CacheType = 1 // EXCEL CACHE_TARS CacheType = 2 // Tencent Tars CACHE_PROTOBUF CacheType = 3 // ProtoBuf )
缓存类型
var ( // CACHE_ROOT_PATH cache路径 CACHE_ROOT_PATH = category.DATA_ROOT_PATH CACHE_TYPE CacheType = CACHE_TARS )
type Security ¶ added in v1.1.5
type Security struct { Code string // 代码 Name string // 名称 VolUnit int // 每手单位 DecimalPoint int // 小数点 IpoDate string // 上市日期 UpdateDate string // 更新日期 TotalCapital float64 // 总股本 Capital float64 // 流通股本 Top10Capital float64 // 前十大流通股东股本 FreeCapital float64 // 自由流通股本 ChangeCapital float64 // 前十大流通股东持仓变化 IncreaseRatio float64 // 当期增持比例 ReductionRatio float64 // 当期减持比例 FinanceValue float64 // 净增长 FinanceEps float64 // 每股收益, 用作计算动态市盈率 earnings per share SafetyScore int // 通达信安全分 BiddingDirection int //竞价方向:-1 -下跌,0 -评判, 1-竟拉 VolumeDirection int //委托量方向: 买盘综合-卖盘综合 09:25:00 }
Security 证券基础信息
type SecurityFeature ¶ added in v1.3.26
type SecurityFeature struct { Date string `json:"Date" array:"0" name:"日期" dataframe:"date,string"` Open float64 `json:"Open" array:"1" name:"开盘" dataframe:"open,float64"` Close float64 `json:"Close" array:"2" name:"收盘" dataframe:"close,float64"` High float64 `json:"High" array:"3" name:"最高" dataframe:"high,float64"` Low float64 `json:"Low" array:"4" name:"最低" dataframe:"low,float64"` Volume int64 `json:"Volume" array:"5" name:"成交量" dataframe:"volume,int64"` Amount float64 `json:"Amount" array:"6" name:"成交额" dataframe:"amount,float64"` Up int `json:"Up" array:"7" name:"上涨家数" dataframe:"up,int64"` Down int `json:"Down" array:"8" name:"下跌家数" dataframe:"down,int64"` LastClose float64 `json:"LastClose" array:"9" name:"昨收" dataframe:"last_close,float64"` TurnoverRate float64 `json:"TurnoverRate" array:"10" name:"换手率" dataframe:"turnover_rate,float64"` OpenVolume int64 `json:"OpenVolume" array:"11" name:"开盘量" dataframe:"open_volume,int64"` OpenTurnZ float64 `json:"OpenTurnZ" array:"12" name:"开盘换手z" dataframe:"open_turnz,float64"` OpenUnmatched int64 `json:"OpenUnmatched" array:"13" name:"开盘未匹配" dataframe:"open_unmatched,int64"` CloseVolume int64 `json:"CloseVolume" array:"14" name:"收盘量" dataframe:"close_volume,int64"` CloseTurnZ float64 `json:"CloseTurnZ" array:"15" name:"收盘换手z" dataframe:"close_turnz,float64"` CloseUnmatched int64 `json:"CloseUnmatched" array:"16" name:"收盘未匹配" dataframe:"close_unmatched,int64"` InnerVolume int64 `json:"InnerVolume" array:"17" name:"内盘" dataframe:"inner_volume,int64"` OuterVolume int64 `json:"OuterVolume" array:"18" name:"外盘" dataframe:"outer_volume,int64"` InnerAmount float64 `json:"InnerAmount" array:"19" name:"流出金额" dataframe:"inner_amount,float64"` OuterAmount float64 `json:"OuterAmount" array:"20" name:"流入金额" dataframe:"outer_amount,float64"` }
SecurityFeature 证券特征信息
type TurnoverDataSummary ¶ added in v1.3.26
type TurnoverDataSummary struct { OpenVolume int64 `json:"OpenVolume" array:"0" name:"开盘量" dataframe:"open_volume,int64"` OpenTurnZ float64 `json:"OpenTurnZ" array:"1" name:"开盘换手z" dataframe:"open_turnz,float64"` OpenUnmatched int64 `json:"OpenUnmatched" array:"2" name:"开盘未匹配" dataframe:"open_unmatched,int64"` CloseVolume int64 `json:"CloseVolume" array:"3" name:"收盘量" dataframe:"close_volume,int64"` CloseTurnZ float64 `json:"CloseTurnZ" array:"4" name:"收盘换手z" dataframe:"close_turnz,float64"` CloseUnmatched int64 `json:"CloseUnmatched" array:"5" name:"收盘未匹配" dataframe:"close_unmatched,int64"` InnerVolume int64 `json:"InnerVolume" array:"6" name:"内盘" dataframe:"inner_volume,int64"` OuterVolume int64 `json:"OuterVolume" array:"7" name:"外盘" dataframe:"outer_volume,int64"` InnerAmount float64 `json:"InnerAmount" array:"8" name:"流出金额" dataframe:"inner_amount,float64"` OuterAmount float64 `json:"OuterAmount" array:"9" name:"流入金额" dataframe:"outer_amount,float64"` }
TurnoverDataSummary 换手数据概要