securities

package
v1.22.21 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 23 Imported by: 13

Documentation

Index

Constants

View Source
const (
	BK_UNKNOWN BlockType = 0  // 未知类型
	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 (
	// ResourcesPath 资源路径
	ResourcesPath = "resources"
)

Functions

func AllCodeList

func AllCodeList() []string

AllCodeList 获取全部证券代码

func BlockTypeNameByCode

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

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

func BlockTypeNameByTypeCode

func BlockTypeNameByTypeCode(blockType BlockType) (string, bool)

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

func CheckoutSecurityInfo

func CheckoutSecurityInfo(securityCode string) (*quotes.Security, bool)

CheckoutSecurityInfo 获取证券信息

func GetStockName

func GetStockName(securityCode string) string

GetStockName 获取证券名称

func IsMarginTradingTarget added in v1.22.1

func IsMarginTradingTarget(code string) bool

IsMarginTradingTarget 是否两融标的

func MarginTradingList added in v1.17.4

func MarginTradingList() []string

MarginTradingList 获取两融标的列表

func OpenEmbed

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

OpenEmbed 打开嵌入式文件

func SectorFilename added in v1.19.3

func SectorFilename(date ...string) string

SectorFilename 板块缓存文件名

func SecurityBaseUnit added in v1.19.5

func SecurityBaseUnit(marketId exchange.MarketType, code string) float64

SecurityBaseUnit 获取证券标价格的最小变动单位, 0.01返回100, 0.001返回1000

func SecurityPriceDigits added in v1.19.5

func SecurityPriceDigits(marketId exchange.MarketType, code string) int

SecurityPriceDigits 获取证券标的价格保留小数点后几位

默认范围2, 即小数点后2位

Types

type BlockInfo

type BlockInfo struct {
	Name              string   `dataframe:"name"`              // 名称
	Code              string   `dataframe:"code"`              // 代码
	Type              int      `dataframe:"type"`              // 类型
	Count             int      `dataframe:"count"`             // 个股数量
	Block             string   `dataframe:"block"`             // 通达信板块编码
	ConstituentStocks []string `dataframe:"ConstituentStocks"` // 板块成份股
}

BlockInfo 板块信息

func BlockList

func BlockList() (list []BlockInfo)

BlockList 板块列表

func GetBlockInfo

func GetBlockInfo(code string) *BlockInfo

type BlockType

type BlockType = int

type FinancingAndSecuritiesLendingTarget added in v1.17.4

type FinancingAndSecuritiesLendingTarget struct {
	Code string `name:"证券代码" dataframe:"code"`
}

type IndustryInfo

type IndustryInfo struct {
	MarketId int    // 市场代码
	Code     string // 股票代码
	Block    string // 行业板块代码
	Block5   string // 二级行业板块代码
	XBlock   string // x行业代码
	XBlock5  string // x二级行业代码
}

IndustryInfo 行业板块对应

type SecurityMarginTrading added in v1.18.3

type SecurityMarginTrading struct {
	DATE            string  `name:"日期" json:"DATE"`
	MARKET          string  `name:"市场" json:"MARKET"`
	SCODE           string  `name:"代码" json:"SCODE"`
	SecName         string  `name:"证券名称" json:"SECNAME"`
	RZYE            float64 `name:"融资余额(元)" json:"RZYE"`
	RQYL            float64 `name:"融券余量(股)" json:"RQYL"`
	RZRQYE          float64 `name:"融资融券余额(元)" json:"RZRQYE"`
	RQYE            float64 `name:"融券余额(元)" json:"RQYE"`
	RQMCL           float64 `name:"融券卖出量(股)" json:"RQMCL"`
	RZRQYECZ        float64 `name:"融资融券余额差值(元)" json:"RZRQYECZ"`
	RZMRE           float64 `name:"融资买入额(元)" json:"RZMRE"`
	SZ              float64 `name:"SZ" json:"SZ"`
	RZYEZB          float64 `name:"融资余额占流通市值比(%)" json:"RZYEZB"`
	RZMRE3D         float64 `name:"3日融资买入额(元)" json:"RZMRE3D"`
	RZMRE5D         float64 `name:"5日融资买入额(元)" json:"RZMRE5D"`
	RZMRE10D        float64 `name:"10日融资买入额(元)" json:"RZMRE10D"`
	RZCHE           float64 `name:"融资偿还额(元)" json:"RZCHE"`
	RZCHE3D         float64 `name:"3日融资偿还额(元)" json:"RZCHE3D"`
	RZCHE5D         float64 `name:"5日融资偿还额(元)" json:"RZCHE5D"`
	RZCHE10D        float64 `name:"10日融资偿还额(元)" json:"RZCHE10D"`
	RZJME           float64 `name:"融资净买额(元)" json:"RZJME"`
	RZJME3D         float64 `name:"3日融资净买额(元)" json:"RZJME3D"`
	RZJME5D         float64 `name:"5日融资净买额(元)" json:"RZJME5D"`
	RZJME10D        float64 `name:"10日融资净买额(元)" json:"RZJME10D"`
	RQMCL3D         float64 `name:"3日融券卖出量(股)" json:"RQMCL3D"`
	RQMCL5D         float64 `name:"5日融券卖出量(股)" json:"RQMCL5D"`
	RQMCL10D        float64 `name:"10日融券卖出量(股)" json:"RQMCL10D"`
	RQCHL           float64 `name:"融券偿还量(股)" json:"RQCHL"`
	RQCHL3D         float64 `name:"3日融券偿还量(股)" json:"RQCHL3D"`
	RQCHL5D         float64 `name:"5日融券偿还量(股)" json:"RQCHL5D"`
	RQCHL10D        float64 `name:"10日融券偿还量(股)" json:"RQCHL10D"`
	RQJMG           float64 `name:"融券净卖出(股)" json:"RQJMG"`
	RQJMG3D         float64 `name:"3日融券净卖出(股)" json:"RQJMG3D"`
	RQJMG5D         float64 `name:"5日融券净卖出(股)" json:"RQJMG5D"`
	RQJMG10D        float64 `name:"10日融券净卖出(股)" json:"RQJMG10D"`
	SPJ             float64 `name:"收盘价" json:"SPJ"`
	ZDF             float64 `name:"涨跌幅" json:"ZDF"`
	RChange3DCP     float64 `name:"3日未识别" json:"RCHANGE3DCP"`
	RChange5DCP     float64 `name:"5日未识别" json:"RCHANGE5DCP"`
	RChange10DCP    float64 `name:"10日未识别" json:"RCHANGE10DCP"`
	KCB             int     `name:"科创板"  json:"KCB"`
	TradeMarketCode string  `name:"二级市场代码" json:"TRADE_MARKET_CODE"`
	TradeMarket     string  `name:"二级市场" json:"TRADE_MARKET"`
	FinBalanceGr    float64 `json:"FIN_BALANCE_GR"`
	SecuCode        string  `name:"证券代码" json:"SECUCODE"`
}

SecurityMarginTrading 融资融券

func GetMarginTradingList added in v1.18.3

func GetMarginTradingList() []SecurityMarginTrading

GetMarginTradingList 获取两融列表

Jump to

Keyboard shortcuts

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