Open half-nirvana opened 5 years ago
Hey, I am the person who worked on the Hong Kong calendar. I plan on implementing the NSE calendar as well as the Singapore SGX calendar either this week or next week. I will likely use something similar to the code on the hk
branch's etc/lunisolar
to compute the holidays based on actual lunisolar rules.
Great!! Thanks!!
Hey Thanks! How can I help!
Hi @llllllllll, I checked out hk branch. I ran all the tests successfully (except few memory 'out of memory errors', probably because I'm running it in a VM with limited memory)
I'm trying to run python etc/lunisolar new-moon
but I'm getting an error FileNotFoundError: [Errno 2] No such file or directory: 'solar-ecliptic-longitude'
The lunisolar
tool works by calculating the ecliptic longitude of the sun and moon to derive the new moons and solar terms. That process currently takes like 40 minutes to an hour so there are two entry points:
solar-ecliptic-longitude
lunar-ecliptic-longitude
that compute these values and save them to disk. The other commands then read the data in these directories to do further processing. This currently computes the new moons and solar terms at minute resolution (UTC) so you can convert them to the appropriate time zone to determine which date they fall on. For example, the Chinese lunisolar calendar says that the day. midnight to midnight UTC+8, that contains the new moon is the start of the month. I am not sure what rules the Indian calendar uses but it should be possible to encode them given this data.
I added NSE calendar for India. (XNSE) Holidays are back dated from 2010 to 2019.
Here's the list of holidays for NSE. Problem is, there are some holidays which follow Gregorian calendar (eg. Republic day, Independence day, Mahatama Gandhi Jayanti etc), some holidays which follow Hindu Calendars (eg. Diwali, Holi) and few holidays follow Islamic calendar (Ramzan, Eid)
How to deal with this. One option I could think is work backwards from data. Take the data of a stock which has traded longest and then figure out holidays based on it.
I am looking at hk branch but have not been able to figure out any solution yet.
Any help on this will be appreciated.
Thanks