Documentation ¶
Overview ¶
Package tradingdays - Check the day is open or not and at which period time 股市開休市判斷(支援非國定假日:颱風假)與當日區間判斷(盤中、盤後、盤後盤)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadCSV ¶
func DownloadCSV(replace bool)
DownloadCSV 更新開休市表
從 https://s3-ap-northeast-1.amazonaws.com/toomore/gogrs/list.csv 下載表更新,主要發生在非國定假日,如:颱風假。
func FindRecentlyOpened ¶
FindRecentlyOpened 回傳最近一個開市時間(UTC 0)
func FindRecentlyOpenedTaipeiZone ¶ added in v1.5.1
FindRecentlyOpenedTaipeiZone 回傳最近一個開市時間(TaipeiZone 0)
Types ¶
type TimePeriod ¶
type TimePeriod struct {
// contains filtered or unexported fields
}
TimePeriod 簡單計算時間是否在當日的開盤前、盤中、盤後盤、收盤的時間
相關時間:
- 開盤前 00:00 ~ 09:00
- 盤中 09:00 ~ 13:30
- 盤後盤 13:30 ~ 14:30
- 收盤 14:30 ~ 24:00
證交所會在 13:30 後產生一次報表,14:30 盤後盤零股交易後還會再產生一次報表。
func NewTimePeriod ¶
func NewTimePeriod(date time.Time) *TimePeriod
NewTimePeriod 建立一個時間區間判斷
Example ¶
var tp = NewTimePeriod(time.Date(2015, 5, 8, 20, 0, 0, 0, utils.TaipeiTimeZone)) fmt.Println(tp.AtBefore(), tp.AtOpen(), tp.AtAfterOpen(), tp.AtClose())
Output: false false false true
func (TimePeriod) AtAfterOpen ¶
func (t TimePeriod) AtAfterOpen() bool
AtAfterOpen 檢查是否為 盤後盤(1330-1430) 期間
Click to show internal directories.
Click to hide internal directories.