tdx

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockPath = "/T0002/blocknew"
	ZxgBlk    = "zxg.blk"
	BkltBlk   = "BKLT.blk"
	ZdBk      = "ZDBK.blk"
)

Variables

View Source
var (
	FBarsStockRaw    = []string{"Open", "Close", "High", "Low", "Vol", "Amount", "DateTime"}
	FBarsStockRename = []string{"open", "close", "high", "low", "volume", "amount", "date"}
	FBarsStockFields = []string{"date", "open", "close", "high", "low", "volume", "amount", "bv", "sv", "ba", "sa"}

	FBarsIndexRaw    = []string{"Open", "Close", "High", "Low", "Vol", "Amount", "DateTime", "UpCount", "DownCount"}
	FBarsIndexRename = []string{"open", "close", "high", "low", "volume", "amount", "date", "up", "down"}
	FBarsIndexFields = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "bv", "sv", "ba", "sa"}
)
View Source
var (
	//RTBarsRaw         = []string{"Date", "Open", "Close", "High", "Low", "Volume", "Amount", "UpCount", "DownCount"}
	RTBarsRename      = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "bv", "sv", "ba", "sa"}
	RTBarsStockFields = []string{"date", "open", "close", "high", "low", "volume", "amount", "bv", "sv", "ba", "sa"}
	RTBarsIndexFields = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "bv", "sv", "ba", "sa"}
)

Functions

func BatchRealtime

func BatchRealtime(codes []string)

BatchRealtime 批量获取实时行情数据

func GetCacheKLine

func GetCacheKLine(code string, argv ...bool) pandas.DataFrame

GetCacheKLine 加载K线

第2个参数, 是否前复权

func GetCacheXdxr added in v0.7.18

func GetCacheXdxr(code string) pandas.DataFrame

func GetKLineAll

func GetKLineAll(fullCode string, argv ...int) pandas.DataFrame

GetKLineAll getKLine 获取日K线

func GetMinuteHistory added in v0.9.16

func GetMinuteHistory(code, date string) *quotes.HistoryMinuteTimeReply

GetMinuteHistory 获得指定日期的分时数据

func GetStockName added in v0.9.21

func GetStockName(code string) (string, bool)

GetStockName 获取证券名称

func GetTickAll

func GetTickAll(code string)

GetTickAll 下载全部tick数据

func GetTickData

func GetTickData(code string, date string) pandas.DataFrame

GetTickData 获取指定日期的分笔成交记录

func GetXdxrInfo added in v0.7.18

func GetXdxrInfo(code string) pandas.DataFrame

GetXdxrInfo 除权除息数据

func GetZxgList added in v0.7.13

func GetZxgList() []string

func QuantityRelativeRatio added in v0.9.16

func QuantityRelativeRatio(code string) float64

QuantityRelativeRatio 获得指定日期的分时数据

量比是衡量相对成交量的指标。
它是指股市开市后平均每分钟的成交量与过去5个交易日(不包含当日)平均每分钟成交量之比。
其计算公式为:量比=(现成交总手数 / 现累计开市时间(分) )/ 过去5日平均每分钟成交量

func RealTime

func RealTime(code string)

RealTime 即时行情数据

Types

type QuoteSnapshot added in v0.8.16

type QuoteSnapshot struct {
	Market         uint8   // 市场
	Code           string  // 代码
	Active1        uint16  // 活跃度
	Price          float64 // 现价
	LastClose      float64 // 昨收
	Open           float64 // 开盘
	High           float64 // 最高
	Low            float64 // 最低
	ServerTime     string  // 时间
	ReversedBytes0 int     // 保留(时间 ServerTime)
	ReversedBytes1 int     // 保留
	Vol            int     // 总量
	CurVol         int     // 现量
	Amount         float64 // 总金额
	SVol           int     // 内盘
	BVol           int     // 外盘
	ReversedBytes2 int     // 保留
	ReversedBytes3 int     // 保留
	//BidLevels      []quotes.Level
	//AskLevels      []quotes.Level
	Bid1           float64
	Ask1           float64
	BidVol1        int
	AskVol1        int
	Bid2           float64
	Ask2           float64
	BidVol2        int
	AskVol2        int
	Bid3           float64
	Ask3           float64
	BidVol3        int
	AskVol3        int
	Bid4           float64
	Ask4           float64
	BidVol4        int
	AskVol4        int
	Bid5           float64
	Ask5           float64
	BidVol5        int
	AskVol5        int
	ReversedBytes4 uint16  // 保留
	ReversedBytes5 int     // 保留
	ReversedBytes6 int     // 保留
	ReversedBytes7 int     // 保留
	ReversedBytes8 int     // 保留
	Rate           float64 // 涨速
	Active2        uint16  // 活跃度
}

func BatchSnapShot added in v0.8.16

func BatchSnapShot(codes []string) []QuoteSnapshot

BatchSnapShot 批量获取即时行情数据快照

type RTSecurityBar added in v0.8.16

type RTSecurityBar struct {
	Date      string
	Open      float64
	Close     float64
	High      float64
	Low       float64
	Volume    float64
	Amount    float64
	UpCount   int     // 指数有效, 上涨家数
	DownCount int     // 指数有效, 下跌家数
	BuyVol    float64 // 外盘
	SellVol   float64 // 内盘
	BuyAmt    float64 // 外盘成交金额
	SellAmt   float64 // 内盘成交金额
}

RTSecurityBar K线数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL