Documentation ¶
Index ¶
- Constants
- Variables
- func CacheId(code string) string
- func CacheIdPath(code string) string
- func CorrectDate(date string) (cacheDate, resourcesDate string)
- func DefaultCanReadDate() string
- func DefaultCanUpdateDate() string
- func GetConfigFilename() string
- func GetDayPath() string
- func GetFeaturesPath() string
- func GetFundFlowPath() string
- func GetHoldingPath() string
- func GetInfoPath() string
- func GetLoggerPath() string
- func GetMetaPath() string
- func GetQuarterlyPath() stringdeprecated
- func GetRootPath() string
- func GetSnapshotPath() string
- func GetTickPath() string
- func GetVariablePath() string
- func GetXdxrPath() string
- func GetZxgFile() string
- func KLineFilename(code string) string
- func QuarterlyReportFilename(code, date string) string
- func Register(plugin DataPlugin) error
- func ReportsFilename(date string) string
- func Reset()
- func TickFilename(code, date string) string
- func Top10HoldersFilename(code, date string) string
- func XdxrFilename(code string) string
- type DataItem
- type DataPlugin
- type Depend
- type Handover
- type Kind
- type Quant1XConfig
- type SecurityFeature
- type TurnoverDataSummary
Constants ¶
View Source
const (
// DefaultDataProvider 默认数据提供者
DefaultDataProvider = "quant1x"
)
View Source
const (
TDX_FORMAT_PROTOCOL_DATE = "20060102"
)
Variables ¶
View Source
var (
ErrAlreadyExists = errors.New("plugin is already exists")
)
Functions ¶
func CacheIdPath ¶
CacheIdPath code从后保留3位, 市场缩写+从头到倒数第3的代码, 确保每个目录只有000~999个代码
func CorrectDate ¶ added in v0.1.5
CorrectDate 校正日期
func DefaultCanReadDate ¶ added in v0.1.5
func DefaultCanReadDate() string
DefaultCanReadDate 获取默认可以读缓存文件的日期
func DefaultCanUpdateDate ¶ added in v0.1.5
func DefaultCanUpdateDate() string
DefaultCanUpdateDate 获取默认可以更新缓存文件的日期
func GetQuarterlyPath
deprecated
added in
v0.1.5
func QuarterlyReportFilename ¶ added in v0.1.5
QuarterlyReportFilename 季报存储路径
info |-- YYYYQ1 |-- sh600105.report |-- YYYYQ2 |-- YYYYQ3 |-- YYYYQ4 Deprecated: 不推荐使用
func ReportsFilename ¶ added in v0.1.5
ReportsFilename 报告数据文件名
func TickFilename ¶ added in v0.2.0
TickFilename tick文件比较多, 目录结构${tick}/${YYYY}/${YYYYMMDD}/${CacheIdPath}
func Top10HoldersFilename ¶ added in v0.1.5
Top10HoldersFilename 前十大流通股股东缓存文件名
Types ¶
type DataPlugin ¶ added in v0.1.7
type DataPlugin interface { // Provider 数据提供者 Provider() string // Kind 优先级排序字段, 潜在的依赖关系 Kind() Kind // Key 字符串关键词 Key() string // Usage 控制台参数提示信息 Usage() string // Init 初始化, 加载配置信息 Init(barIndex *int, date string) error // Check 数据校验 Check(cacheDate, featureDate string) // Print 控制台输出指定日期的数据 Print(code string, date ...string) }
DataPlugin 数据插件
func PluginsWithName ¶ added in v0.2.0
func PluginsWithName(pluginType Kind, keywords ...string) (list []DataPlugin)
type Handover ¶ added in v0.1.7
type Handover interface { // ChangingOverDate 缓存数据转换日期 // 数据集等基础数据不需要切换日期 ChangingOverDate(date string) }
Handover 缓存切换接口
type Quant1XConfig ¶
type Quant1XConfig struct {
BaseDir string `json:"basedir"`
}
Quant1XConfig Quant1X基础配置
type SecurityFeature ¶ added in v0.2.0
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"` ChangeRate float64 `json:"ChangeRate" array:"10" name:"涨跌幅" dataframe:"change_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 v0.2.0
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 换手数据概要
Click to show internal directories.
Click to hide internal directories.