security

package
v1.2.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	//BK_UNKNOWN BlockType = iota
	BK_HANGYE  BlockType = 2  // 行业
	BK_DIQU    BlockType = 3  // 地区
	BK_GAINIAN BlockType = 4  // 概念
	BK_FENGGE  BlockType = 5  // 风格
	BK_ZHISHU  BlockType = 6  // 指数
	BK_YJHY    BlockType = 12 // 研究行业

	BKN_HANGYE  = "行业"
	BKN_DIQU    = "地区"
	BKN_GAINIAN = "概念"
	BKN_FENGGE  = "风格"
	BKN_ZHISHU  = "指数"
	BKN_YJHY    = "研究行业"
)

Variables

View Source
var (
	// ErrCacheNotExist 没有缓存
	ErrCacheNotExist = errors.New("Cache not exist")
	// ErrCodeNotExist 证券代码不存在
	ErrCodeNotExist = errors.New("Securities code does not exist")
)
View Source
var (
	// ResourcesPath 资源路径
	ResourcesPath = "resources"
)

Functions

func BlockTypeNameByCode added in v1.0.4

func BlockTypeNameByCode(blockCode int) (name string, ok bool)

BlockTypeNameByCode 通过板块类型代码获取板块类型名称

func BlockTypeNameByTypeCode added in v1.2.2

func BlockTypeNameByTypeCode(blockType BlockType) (string, bool)

通过板块类型代码获取板块类型名称

func GetStockCode

func GetStockCode(market string, code string) string

func OpenEmbed added in v0.8.11

func OpenEmbed(name string) (fs.File, error)

OpenEmbed 打开嵌入式文件

func WriteBasicInfo

func WriteBasicInfo(market string, array []byte)

Types

type BlockInfo added in v0.8.11

type BlockInfo struct {
	Name  string   // 名称
	Code  string   // 代码
	Type  int      // 类型
	Count int      // 个股数量
	Block string   // 通达信板块编码
	List  []string // 代码列表
}

BlockInfo 板块信息

type BlockType added in v1.0.4

type BlockType int

type HyInfo added in v0.9.25

type HyInfo struct {
	Code   string // 股票代码
	Block  string // 通达信板块代码
	Block5 string // 通达信板块代码
}

HyInfo 行业板块对应

type Security

type Security struct {
	Market int32  `json:"market,omitempty"` //QotMarket,股票市场
	Code   string `json:"code,omitempty"`   //股票代码
}

Security 两个字段确定一支股票

type StaticBasic

type StaticBasic struct {
	Security      Security `json:"security,omitempty"`      //股票
	Id            int64    `json:"id,omitempty"`            //股票ID
	LotSize       int32    `json:"lotSize,omitempty"`       //每手数量,期权以及期货类型表示合约乘数
	SecType       int32    `json:"secType,omitempty"`       //Qot_Common.SecurityType,股票类型
	Name          string   `json:"name,omitempty"`          //股票名字
	ListTime      string   `json:"listTime,omitempty"`      //上市时间字符串
	Delisting     bool     `json:"delisting,omitempty"`     //是否退市
	ListTimestamp float64  `json:"listTimestamp,omitempty"` //上市时间戳, 秒数

}

func GetBasicInfo

func GetBasicInfo(code string) (*StaticBasic, error)

func GetStaticBasic

func GetStaticBasic(market string) (list []StaticBasic, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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