trading

package
v1.3.47 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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股休市-分
)

Variables

View Source
var (
	CN_TOTALFZNUM = 0 // A股全天交易的分钟数
)

Functions

func CurrentlyTrading

func CurrentlyTrading(date ...string) bool

CurrentlyTrading 今天的交易是否已经开始

func DateIsTradingDay

func DateIsTradingDay(date ...string) bool

DateIsTradingDay date是否交易日?默认是今天

func FixTradeDate

func FixTradeDate(date string) string

FixTradeDate 强制修正交易日字符串, 统一格式YYYY-MM-DD

func IndexToday

func IndexToday() string

IndexToday 当天

func IsHoliday

func IsHoliday(date string) bool

IsHoliday 是否节假日

func IsTrading

func IsTrading(date ...string) bool

func LastNDate

func LastNDate(date string, n ...int) []string

LastNDate 获得指定日期前的N个交易日期数组

func LastTradeDate

func LastTradeDate() string

LastTradeDate 获得最后一个交易日

func Minutes

func Minutes(date ...string) int

Minutes 分钟数

func NextTradeDate

func NextTradeDate(date string) string

NextTradeDate 获取指定日期的下一个交易日

func Today

func Today() string

Today 当日, 区别于IndexToday, IndexToday可能存在调整

func TradeRange

func TradeRange(start, end string) []string

TradeRange 输出交易日范围

Types

type TimeRange

type TimeRange struct {
	Begin time.Time
	End   time.Time
}

Jump to

Keyboard shortcuts

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