Documentation ¶
Index ¶
- Constants
- Variables
- func CanInitialize(lastModified time.Time) (toInit bool)
- func CanUpdate(lastModified time.Time) (updated bool)
- func CompareTime(t1, t2 string) (bool, error)
- func CurrentlyTrading(date ...string) bool
- func DateIsTradingDay(date ...string) bool
- func FixTradeDate(date string) string
- func GetCurrentlyDay() (currentlyDay string)
- func GetFrontTradeDay() string
- func GetLastDayForUpdate() string
- func GetTodayTimeByString(timeStr string) (time.Time, error)
- func IndexToday() string
- func IsHoliday(date string) bool
- func IsTimeInRange(timeStr, startStr, endStr string) (bool, error)
- func IsTrading(date ...string) bool
- func LastNDate(date string, n ...int) []string
- func LastTradeDate() string
- func Minutes(date ...string) int
- func NextTradeDate(date string) string
- func Today() string
- func TradeRange(start, end string) []string
- type Calendar
- type TimeRange
Constants ¶
View Source
const ( CN_InitTime = "09:00:00.000" // A股数据初始化时间 CN_SERVERTIME_FORMAT = "15:04:05.000" // 服务器时间格式 CN_StartTime = "09:15:00.000" // A股数据初始化时间 CN_StopTime = "15:00:00.000" // A股数据结束时间 BEGIN_A_AM_HOUR = 9 // A股开市-时 BEGIN_A_AM_MINUTE = 30 // A股开市-分 END_A_AM_HOUR = 11 // A股休市-时 END_A_AM_MINUTE = 30 // A股休市-分 BEGIN_A_PM_HOUR = 13 // A股开市-时 BEGIN_A_PM_MINUTE = 0 // A股开市-分 END_A_PM_HOUR = 15 // A股休市-时 END_A_PM_MINUTE = 0 // A股休市-分 BEGIN_A_AUCTION = "09:15:00" // A股上午集合竞价开始时间 END_A_AUCTION = "09:25:00" // A股上午集合竞价结束时间 END_A_AUCTION_SPE = "09:26:00" // A股上午集合竞价结束时间过一分钟 BEGIN_P_AUCTION = "14:57:00" // A股下午集合竞价开始时间 END_P_AUCTION = "15:01:00" // A股下午集合竞价结束时间 END_P_AUCTION_SPE = "15:02:00" // A股下午集合竞价结束时间过一分钟 CN_SERVERTIME_SHORT_FORMAT = "15:04:05" // 服务器时间格式 CN_DEFAULT_TOTALFZNUM = 240 // A股默认全天交易240分钟 )
View Source
const (
TimeOnly = time.TimeOnly // 时分秒的格式
)
Variables ¶
View Source
var (
CN_TOTALFZNUM = 0 // A股全天交易的分钟数
)
View Source
var (
ErrNoUpdateRequired = errors.New("No update required")
)
Functions ¶
func CanInitialize ¶
CanInitialize 数据是否初始化(One-time update)
func CompareTime ¶
CompareTime 比较两个时间字符串大小 如果t1 <= t2 返回true,否则返回false 如果格式不正确或转换错误,返回错误
func GetCurrentlyDay ¶
func GetCurrentlyDay() (currentlyDay string)
GetCurrentlyDay 获取数据有效的最后一个交易日, 以9点整划分
func GetTodayTimeByString ¶
GetTodayTimeByString 返回当天指定时刻的时间
func IsTimeInRange ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.