Hoping that someone could provide a function that given a date, it will return the NYSE trading day of month.
If it takes into consideration holidays that is a bonus, if not I’m not too worried.
Thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are a few packages that handle fiddly calendar issues, which are fiddly. To quote from
timeDate:“It is non-trivial to implement function for business days, weekends and holidays. It is not difficult in an algorithmic sense, but it can become tedious to implement the rules of the calendar themselves, for example the date of Easter.”
Still, if I have interpreted your question correctly, something like this should work (although you might want to think about the result you want if
myDateis not itself a trading day…at the moment it gives the trading day of the previous trading day).