Documentation ¶
Index ¶
- Constants
- func AssertIndexByMarketAndCode(marketId MarketType, symbol string) (isIndex bool)
- func AssertIndexBySecurityCode(securityCode string) (isIndex bool)
- func AssertStockByMarketAndCode(marketId MarketType, symbol string) (isStock bool)
- func AssertStockBySecurityCode(securityCode string) (isStock bool)
- func GetMarket(symbol string) string
- func GetMarketFlag(marketId MarketType) string
- func GetMarketId(symbol string) uint8
- func GetSecurityCode(market MarketType, symbol string) (securityCode string)
- func MarketLimit(securityCode string) float64
- type MarketType
Constants ¶
View Source
const ( STD_MSG_HEARTBEAT = 0x0004 // 心跳维持 STD_MSG_LOGIN1 = 0x000d // 第一次登录 STD_MSG_LOGIN2 = 0x0fdb // 第二次登录 STD_MSG_XDXR_INFO = 0x000f // 除权除息信息 STD_MSG_FINANCE_INFO = 0x0010 // 财务信息 STD_MSG_PING = 0x0015 // 测试连接 STD_MSG_COMPANY_CATEGORY = 0x02cf // 公司信息文件信息 STD_MSG_COMPANY_CONTENT = 0x02d0 // 公司信息描述 STD_MSG_SECURITY_COUNT = 0x044e // 证券数量 STD_MSG_SECURITY_LIST = 0x0450 // 证券列表 STD_MSG_INDEXBARS = 0x052d // 指数K线 STD_MSG_SECURITY_BARS = 0x052d // 股票K线 STD_MSG_SECURITY_QUOTES_old = 0x053e // 行情信息 STD_MSG_SECURITY_QUOTES_new = 0x054c // 行情信息 STD_MSG_MINUTETIME_DATA = 0x051d // 分时数据 STD_MSG_BLOCK_META = 0x02c5 // 板块文件信息 STD_MSG_BLOCK_DATA = 0x06b9 // 板块文件数据 STD_MSG_TRANSACTION_DATA = 0x0fc5 // 分笔成交信息 STD_MSG_HISTORY_MINUTETIME_DATA = 0x0fb4 // 历史分时信息 STD_MSG_HISTORY_TRANSACTION_DATA = 0x0fb5 // 历史分笔成交信息 )
标准行情-命令字
View Source
const ( KLINE_TYPE_5MIN = 0 // 5 分钟 K线 KLINE_TYPE_15MIN = 1 // 15 分钟 K线 KLINE_TYPE_30MIN = 2 // 30 分钟 K线 KLINE_TYPE_1HOUR = 3 // 1 小时 K线 KLINE_TYPE_DAILY = 4 // 日 K线 KLINE_TYPE_WEEKLY = 5 // 周 K线 KLINE_TYPE_MONTHLY = 6 // 月 K线 KLINE_TYPE_EXHQ_1MIN = 7 // 1分钟 KLINE_TYPE_1MIN = 8 // 1 分钟 K线 KLINE_TYPE_RI_K = 9 // 日 K线 KLINE_TYPE_3MONTH = 10 // 季 K线 KLINE_TYPE_YEARLY = 11 // 年 K线 )
K线种类
View Source
const ( Compressed = uint8(0x10) // 压缩标志 FlagNotZipped = uint8(0x0c) // zip未压缩 FlagZipped = uint8(Compressed | FlagNotZipped) // zip已压缩 消息头标志 0x789C )
View Source
const ( MarketShangHai string = "sh" // 上海 MarketShenZhen string = "sz" // 深圳 MarketBeiJing string = "bj" // 北京 MarketHongKong string = "hk" // 香港 MarketUSA string = "us" // 美国 )
View Source
const ( MARKET_CN_FIRST_DATE = "19901219" // 上证指数的第一个交易日 MARKET_CH_FIRST_LISTTIME = "1990-12-19" // 个股上市日期 )
Variables ¶
This section is empty.
Functions ¶
func AssertIndexByMarketAndCode ¶ added in v1.6.3
func AssertIndexByMarketAndCode(marketId MarketType, symbol string) (isIndex bool)
AssertIndexByMarketAndCode 通过市场id和短码判断是否指数
func AssertIndexBySecurityCode ¶ added in v1.6.7
AssertIndexBySecurityCode 通过证券代码判断是否指数
func AssertStockByMarketAndCode ¶ added in v1.6.8
func AssertStockByMarketAndCode(marketId MarketType, symbol string) (isStock bool)
AssertStockByMarketAndCode 通过市场id和代码判断是否个股
func AssertStockBySecurityCode ¶ added in v1.6.8
AssertStockBySecurityCode 通过证券代码判断是否个股
func GetMarket ¶ added in v1.1.3
GetMarket 判断股票ID对应的证券市场匹配规则
['50', '51', '60', '90', '110'] 为 sh ['00', '12','13', '18', '15', '16', '18', '20', '30', '39', '115'] 为 sz ['5', '6', '9'] 开头的为 sh, 其余为 sz
func GetMarketFlag ¶ added in v1.6.3
func GetMarketFlag(marketId MarketType) string
func GetSecurityCode ¶ added in v1.6.7
func GetSecurityCode(market MarketType, symbol string) (securityCode string)
Types ¶
type MarketType ¶ added in v1.6.7
type MarketType = uint8
const ( MarketIdShenZhen MarketType = iota // 深圳 MarketIdShangHai MarketType = 1 // 上海 MarketIdBeiJing MarketType = 2 // 北京 MarketIdHongKong MarketType = 21 // 香港 MarketIdUSA MarketType = 22 // 美国 StockDelisting = "DELISTING" // 退市 )
func DetectMarket ¶ added in v1.6.7
func DetectMarket(symbol string) (marketId MarketType, market string, code string)
DetectMarket 检测市场代码
Click to show internal directories.
Click to hide internal directories.