Documentation ¶
Overview ¶
Package calendar provides market calendar, with which you can check if the market is open at specific point of time. Though the package is generalized to support different market calendars, only the NASDAQ is implemented at this moment. You can create your own calendar if you provide the calendar json string. See nasdaq.go for the format.
Index ¶
- Variables
- type Calendar
- func (calendar *Calendar) EpochIsMarketOpen(epoch int64) bool
- func (calendar *Calendar) EpochMarketClose(epoch int64) *time.Time
- func (calendar *Calendar) IsMarketDay(t time.Time) bool
- func (calendar *Calendar) IsMarketOpen(t time.Time) bool
- func (calendar *Calendar) MarketClose(t time.Time) *time.Time
- func (calendar *Calendar) Tz() *time.Location
- type MarketState
- type Time
Constants ¶
This section is empty.
Variables ¶
var Nasdaq = New(NasdaqJSON)
Nasdaq implements market calendar for the NASDAQ.
var NasdaqJSON = `` /* 10887-byte string literal not displayed */
Functions ¶
This section is empty.
Types ¶
type Calendar ¶
type Calendar struct {
// contains filtered or unexported fields
}
func (*Calendar) EpochIsMarketOpen ¶
EpochIsMarketOpen returns true if epoch in calendar's timezone is in the market hours.
func (*Calendar) EpochMarketClose ¶
EpochMarketClose determines the market close time of the day that the supplied epoch timestamp occurs on. Returns nil if it is not a market day.
func (*Calendar) IsMarketDay ¶
IsMarketDay check if today is a trading day or not.
func (*Calendar) IsMarketOpen ¶
IsMarketOpen returns true if t is in the market hours.
func (*Calendar) MarketClose ¶
MarketClose determines the market close time of the day that the supplied timestamp occurs on. Returns nil if it is not a market day.