Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
another date challenge
#14
Quote:......
A function for a project of mine needs to get the next trading day (e.g.: Monday through Friday).....
I think you're going to have to identify holidays, falling on Monday to Friday, which are not trading days for the location where the program is to be run.

This a pain because you need to create a table or file of these holidays, and update the table every year.

You could also try to program these holidays. Examples in the USA: Martin Luther King's birthday is celebrated on the third Monday in January. Thanksgiving is the fourth Thursday in November. If Good Friday is a holiday at your location, you will also need to compute the date of Easter. Banking laws in some countries inhibit banks from being closed for more than 4 days. So, if a Friday is a holiday, then Thursday and Monday cannot both be holidays. Trading days generally adhere to bank holidays.

Computing all these holidays can get tedious. The holiday table or file is less elegant and perhaps prone to user error, but much simpler.

EDIT: I think that The best solution would be to get the holiday table/file from the applicable stock exchange directly.


Regards..... Moneo
Reply


Messages In This Thread
another date challenge - by Agamemnus - 12-11-2006, 11:04 PM
another date challenge - by DrV - 12-12-2006, 03:44 AM
another date challenge - by Agamemnus - 12-13-2006, 01:02 AM
another date challenge - by DrV - 12-14-2006, 12:41 AM
Re: another date challenge - by Moneo - 12-14-2006, 06:36 AM
another date challenge - by Agamemnus - 12-16-2006, 01:23 AM
another date challenge - by Antoni Gual - 12-16-2006, 01:47 AM
another date challenge - by Moneo - 12-18-2006, 08:48 AM
another date challenge - by Antoni Gual - 12-18-2006, 10:26 PM
another date challenge - by Agamemnus - 12-19-2006, 12:07 AM
another date challenge - by Antoni Gual - 12-19-2006, 02:07 AM
another date challenge - by Agamemnus - 12-25-2006, 06:13 AM
another date challenge - by Antoni Gual - 12-25-2006, 03:30 PM
another date challenge - by Moneo - 12-26-2006, 01:00 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)