category

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CACHE_DIR_MODE 目录权限
	CACHE_DIR_MODE os.FileMode = 0755
	// CACHE_FILE_MODE 文件权限
	CACHE_FILE_MODE os.FileMode = 0644

	// DEBUG 调试开关
	DEBUG = false
)
View Source
const (
	D_OK    = 0x00000000 // 数据正常
	D_ERROR = 0x40000000 // 数据错误
	D_ECODE = 0x00000001 // 代码错误
	D_ENET  = 0x00000002 // 网络异常
	D_EDATA = 0x00000004 // 数据错误
	D_EDISK = 0x00000008 // 写文件错误
	D_ENEED = 0x00000010 // 不需要更新
)
View Source
const (
	MARKET_SH string = "sh" // 上海
	MARKET_SZ string = "sz" // 深圳
	MARKET_BJ string = "bj" // 北京
	MARKET_HK string = "hk" // 香港
	MARKET_US string = "us" // 美国
)
View Source
const (
	// USEC_PER_SEC number of microseconds per second
	USEC_PER_SEC int64 = 1000000
	// MsecPerSec number of milliseconds per second
	MsecPerSec int64 = 1000
	// SecondOfDay 一天的秒数
	SecondOfDay int64 = 24 * 60 * 60
	// MillisecondsOfDay 一天的毫秒数
	MillisecondsOfDay int64 = SecondOfDay * MsecPerSec
	// RealTimenterval 实时数据间隔时间, 单位毫秒
	RealTimenterval int64 = 5 * 1000

	// NullState 正常状态, 字符串"01"
	NullState   = "00"
	NormalState = "01"

	// 历史数据获取的时间, 时, 分, 秒
	HistoryUpdateHour = 17
	HistoryUpdateMin  = 0
	HistoryUpdateSec  = 0

	CACHE_DATE = "20060102"   // 缓存日期
	INDEX_DATE = "2006-01-02" // 索引日期格式
	TDX_DATE   = "20060102"   // 通达信日期
)

Variables

View Source
var (
	// DATA_ROOT_PATH 数据根路径
	DATA_ROOT_PATH = "~/.quant1x"
	// KLINE_PATH 日线数据文件路径
	KLINE_PATH = DATA_ROOT_PATH + "/day"
	// LOG_ROOT_PATH 日志路径
	LOG_ROOT_PATH = DATA_ROOT_PATH + "/logs"
)

Functions

func GetCodeList added in v0.7.11

func GetCodeList() []string

GetCodeList 加载全部股票代码

func GetMarket deprecated added in v0.7.11

func GetMarket(symbol string) string

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

Deprecated: 不推荐使用

Types

type Market added in v0.7.11

type Market = uint8
const (
	MARKET_ID_SHENZHEN Market = iota // 深圳
	MARKET_ID_SHANGHAI Market = 1    // 上海
	MARKET_ID_BEIJING  Market = 2    // 北京
	MARKET_ID_HONGKONG Market = 21   // 香港
	MARKET_ID_USA      Market = 22   // 美国
)

func DetectMarket added in v0.7.11

func DetectMarket(symbol string) (Market, string, string)

DetectMarket 检测市场代码

func GetMarketId added in v0.7.11

func GetMarketId(symbol string) Market

GetMarketId 获得市场ID Deprecated: 不推荐使用

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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