zgsrc / fincal Goto Github PK
View Code? Open in Web Editor NEWMarket holidays and trading hours.
Market holidays and trading hours.
package.json
lists the license as ISC and README.md
contains the text of the ISC license in the License section, but the LICENSE
file contains the text of the MIT License. Could you please clarify which of these licenses applies to the project. Thanks!
calendar.isRegularTradingDay({
year: 2020,
month: 08,
day: 02
})
calendar.areMarketsOpenOn({
year: 2020,
month: 08,
day: 02
})
both return true and its a sunday.
Hey there, thanks for your work in setting up this project. I've been eager to use it in some of my projects.
I had a few questions surrounding the usage of the tradingSession
functions. I've been using the new_york
calendar exclusively for these examples.
The tradingSession
and tradingSessions
calls seem to return incorrect results when called with a specific moment.
console.log(calendar.tradingSessions(moment("2020-09-01T16:30:00.000Z")));
console.log(calendar.tradingSessions(moment("Tue, 01 Sep 2020 9:30:00 PDT")));
both yield moments where the start is 2020-09-01T16:30:00.000Z
and the end is 2020-09-01T23:00:00.000Z
, even though the expected UTC times for NYC are 13:30 to 20:00.
Debugging a bit into this, it seems like this is because the sessions are created assuming 9:30am and 4:00pm in the local timezone, which in my case is America/Los_Angeles
. Is there a way to retrieve the correct NYC-based moments for the trading sessions? Or to derive the correct start/end times for GMT-7?
I noticed the setTimezoneHere
method in the documentation, which didn't work correctly out of the package as it isn't attached to the fincal
or calendar
objects. I pulled the method into the calendar export and tried calling calendar.setTimezoneHere("America/Los_Angeles");
before the same lines above with no change.
For the nextTradingSession
function, I noticed that it only supports days and not specific times. Is there any plans to support this or any alternatives? Assuming I can get the first problem figured out I'm also happy to tinker with it.
Hello,
calendar.tradingSessions({ year: 2020, month: 5, day: 1 })
I've tried to get the session data for May 1 2020 and got the data for June 1 2020
Looks like months start at 0, but years and days don't.
It's MLK evening over in the US right now (10:30pm Eastern) and GLOBEX is in session, but fincal.calendar('new_york').areMarketsOpenNow(true)
returns false because the code concludes today is a holiday.
OK, GLOBEX is not "new_york", so this might be a feature request to add "chicago", but the logic at line 421 is still wrong for E-mini contracts that trade for 23.25 hours a day.
It would flag issues such as else
after return
, which are seen throughout the code.
$ grep exports.timezone locales/*.js
locales/copenhagen.js:exports.timezone = "Europe/Copenhagen";
locales/frankfurt.js:exports.timezone = "Europe/Berlin";
locales/hong_kong.js:exports.timezone = "Asia/Hong_Kong";
locales/london.js:exports.timezone = "Europe/London";
locales/new_york.js:exports.timezone = "America/New_York";
locales/paris.js:exports.timezone = "Europe/Paris";
locales/shanghai.js:exports.timezone = "Asia/Shanghai";
locales/sydney.js:exports.timezone = "Asia/Shanghai";
locales/tokyo.js:exports.timezone = "Asia/Shanghai";
So, the last two seem wrong. Sydney is 3 hours ahead of Shanghai (this time of year)!
https://github.com/zgsrc/fincal/blob/master/locales/london.js
May 8 is though.
https://github.com/triploc/fincal/blob/master/calendar.js#L344
You have time.minutes
, not time.minutes()
.
Need the latest change for the library to work in my code. Could you please make another release?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.