|
Mark Holstius
 Elite
    Posts: 744
Joined: 10/11/2012
Location: Sleepy Hollow, IL
User Profile |
Now that we have export capability (thanks Ed), it may be more accurate to use trading days in many calculations - and this is somewhat difficult in Excel. I’ve put together a SS with 2 tabs that can be copied into any spreadsheet. You can then modify the formulas to find the nearest trading date “on or before” or “after” a date based on Daily, End Of Week, End Of Month, or End Of Quarter. It can also be used to accurately find the # of trading days between 2 dates.

The data is accurate from 12/31/1999 thru 12/31/2015 and accounts for all holidays.
You just need to “Paste Special Values & Number Formats” all the data from the “Dates” tab starting in cell A1 of a new tab on your spreadsheet also named “Dates”.
You can then copy and paste any of the 9 formulas included on the “Lookup Date Example” tab appropriate to your needs and substitute your date cell references in the formulas as necessary.


Hope this helps with everyone’s research (to all of our benefit…)
Mark
[Edited by Mark Holstius on 4/18/2014 12:30 PM]
Attached file : Trading Days Calculations 2000-2015.xlsx (1060KB - 229 downloads)
Attached file : Dates.jpg (119KB - 404 downloads)
Attached file : EOW Example.jpg (791KB - 388 downloads)
Attached file : Trading Days Between Dates Example.jpg (753KB - 387 downloads)
|
|
Jim Dean
 Elite
   Posts: 1059
Joined: 10/11/2012
Location: L'ville, GA
User Profile |
Hi, Mark
This is great ... thanks. I'm willing to help you enhance it, so that it deals not just with weekends and holidays, but also knows about all the special market shutdowns related to the year end accounting days, national disasters, presidential funerals, etc etc, since 1990 on through about 2040 or so (of course does not know about emergency stuff for the future ;~)
I created an OLang routine to do this a long time ago, and Nirvana (Cose) used it as the basis to "check" all the US Stocks EOD data in their database to find "holes" ... and filled them (hooray) ... in fact, OmniData is now BETTER in that regard than any other datasource Cose and I investigated (Esig, Yahoo, etc).
The conversion from OLang will be somewhat messy ... probably a macro. I'll need to restructure the routine a little bit so that the output matches what you are doing for the SS. I'll send you the adapted OLang indicator (used for FL column output and debugmsg output) ... you'll need to convert it to Excel-eze as you see fit.
So, let me know if you're interested in incorporating this, just to dot all the i's and cross all the t's.
[Edited by Jim Dean on 4/18/2014 12:41 PM]
|
|
Mark Holstius
 Elite
    Posts: 744
Joined: 10/11/2012
Location: Sleepy Hollow, IL
User Profile |
Thanks for the offer Jim - but this already includes all the market shutdowns and missed dates (2011, funerals, etc) in addition to the standard weekends and holidays as of today.
Glad to hear you were able to help with the Nirvana data too...
Mark
|
|
kmcintyre
 Elite
       Posts: 890
Joined: 10/11/2012
Location: Portland, OR
User Profile |
Excellent! Thanks, Mark.
It would be nice to extend the expiration date past 12/31/2015. Time flies...
Cheers
Keith
|