Documentation ¶
Index ¶
- Constants
- Variables
- func AssertIndexByMarketAndCode(marketId Market, code string) (isIndex bool)
- func AssertIndexBySecurityCode(securityCode string) (isIndex bool)
- func CodeIsIndex(securityCode string) bool
- func GetMarketName(marketId Market) string
- func GetMonthDay() (string, string)
- func GetQuarterDay(months ...int) (string, string)
- func GetWeekDay() (string, string)
- func MarketLimit(securityCode string) float64
- type Market
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 // CACHE_REPLACE 文件替换模式, 会用到os.TRUNC CACHE_REPLACE = os.O_CREATE | os.O_RDWR | os.O_TRUNC // CACHE_UPDATE 更新 CACHE_UPDATE = os.O_CREATE | os.O_WRONLY )
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" // 通达信日期 YearOnly = "2006" )
View Source
const (
MARKET_CN_FIRST_DATE = "19901219" // 上证指数的第一个交易日
)
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 AssertIndexByMarketAndCode ¶ added in v1.2.6
AssertIndexByMarketAndCode 通过市场id和短码判断是否指数
func AssertIndexBySecurityCode ¶ added in v1.2.9
AssertIndexBySecurityCode 通过证券代码判断是否指数
func GetMarketName ¶ added in v0.7.17
GetMarketName 通过市场ID取得市场名称缩写
func GetQuarterDay ¶ added in v1.1.6
GetQuarterDay 获得当前季度的初始和结束日期
func MarketLimit ¶ added in v0.8.16
MarketLimit 涨跌停板限制
Types ¶
Click to show internal directories.
Click to hide internal directories.