The library uses the current time to determine if the market is open, closed, or closed early. It also determines if the current day is a holiday.
Make sure you have Go
installed on your machine.
You can check by running the following command in the console
go version
If you don't have Go
installed, you can download it from here.
Run the following command in the console
, in the project directory
, to install the library with go get
go get github.com/ggoodwin/go-nyse-time
Add the import to your .go
file
import nyse_time "github.com/ggoodwin/go-nyse-time"
// Returns: bool
open := nyse_time.IsMarketOpen()
// Parameters: time.Time
// Returns: bool
open := nyse_time.IsMarketOpenCustom(time.Time)
// Parameters: time.Time
// Returns: bool
isHoliday := nyse_time.IsHoliday(time.Time)
// Parameters: time.Time
// Returns: bool
isEarlyClose := nyse_time.IsEarlyClose(time.Time)
// Parameters: time.Time
// Returns: bool
isWeekend := nyse_time.IsWeekend(time.Time)
If you find an issue with this library, please report the issue using our GITHUB-ISSUES or check out the SECURITY details if it is security related.
If you'd like, I welcome any contributions. Please read the CONTRIBUTING document then FORK this library and submit a PULL-REQUEST. Make sure to click compare across forks
to see your fork.
This project is under the MIT License. See the LICENSE file for the full license text.
Check out our CHANGELOG
Please read my CODE-OF-CONDUCT before contributing or engaging in discussions.