From 576936ead0dd5987e502448cef6ded8317c03293 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 14 Feb 2025 18:58:39 -0500 Subject: [PATCH] Add GenerateFutureDates --- MarketDataLib/Utility/DateGenerator.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/MarketDataLib/Utility/DateGenerator.cs b/MarketDataLib/Utility/DateGenerator.cs index 75f99f4..b5b6d10 100644 --- a/MarketDataLib/Utility/DateGenerator.cs +++ b/MarketDataLib/Utility/DateGenerator.cs @@ -342,6 +342,30 @@ namespace MarketData.Utils } return histDates; } + /// + /// Generates dates into the future respecting weekens and market holidays + /// + /// + /// + /// + public List GenerateFutureDates(DateTime startDate, int dayCount) + { + List futureDates=new List(); + DateTime futureDate; + TimeSpan singleDay; + + startDate = startDate.Date; + futureDate=startDate; + if(dayCount<0)singleDay=new TimeSpan(1,0,0,0); + else singleDay=new TimeSpan(1,0,0,0); + dayCount=dayCount<0?-dayCount:dayCount; + while(futureDates.Count