Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Data/market-hours/market-hours-database.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"1/20/2025",
"1/19/2026",
"1/18/2027",
"1/17/2028",
"2/16/1998",
"2/15/1999",
"2/21/2000",
Expand Down Expand Up @@ -181,6 +182,7 @@
"2/17/2025",
"2/16/2026",
"2/15/2027",
"2/21/2028",
"4/10/1998",
"4/2/1999",
"4/21/2000",
Expand Down Expand Up @@ -211,6 +213,7 @@
"4/18/2025",
"4/3/2026",
"3/26/2027",
"4/14/2028",
"5/25/1998",
"5/31/1999",
"5/29/2000",
Expand Down Expand Up @@ -241,13 +244,15 @@
"5/26/2025",
"5/25/2026",
"5/31/2027",
"5/29/2028",
"6/11/2004",
"6/20/2022",
"6/19/2023",
"6/19/2024",
"6/19/2025",
"6/19/2026",
"6/18/2027",
"6/19/2028",
"7/3/1998",
"7/5/1999",
"7/4/2000",
Expand Down Expand Up @@ -278,6 +283,7 @@
"7/4/2025",
"7/3/2026",
"7/5/2027",
"7/4/2028",
"9/7/1998",
"9/6/1999",
"9/4/2000",
Expand Down Expand Up @@ -308,6 +314,7 @@
"9/1/2025",
"9/7/2026",
"9/6/2027",
"9/4/2028",
"9/11/2001",
"9/12/2001",
"9/13/2001",
Expand Down Expand Up @@ -344,6 +351,7 @@
"11/27/2025",
"11/26/2026",
"11/25/2027",
"11/23/2028",
"12/05/2018",
"12/25/1998",
"12/24/1999",
Expand Down Expand Up @@ -374,7 +382,8 @@
"12/25/2024",
"12/25/2025",
"12/25/2026",
"12/24/2027"
"12/24/2027",
"12/25/2028"
],
"earlyCloses": {
"7/3/2000": "13:00:00",
Expand All @@ -393,6 +402,7 @@
"7/3/2023": "13:00:00",
"7/3/2024": "13:00:00",
"7/3/2025": "13:00:00",
"7/3/2028": "13:00:00",
"11/26/1999": "13:00:00",
"11/24/2000": "13:00:00",
"11/23/2001": "13:00:00",
Expand Down Expand Up @@ -422,6 +432,7 @@
"11/28/2025": "13:00:00",
"11/27/2026": "13:00:00",
"11/26/2027": "13:00:00",
"11/24/2028": "13:00:00",
"12/24/2001": "13:00:00",
"12/24/2002": "13:00:00",
"12/24/2003": "13:00:00",
Expand Down
30 changes: 30 additions & 0 deletions Tests/Common/Securities/MarketHoursDatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,36 @@ public void CorrectlyReadsUsEquityEarlyCloses()
Assert.AreEqual(earlyCloseTime, equityHours.EarlyCloses[date]);
}

[Test]
public void CorrectlyReadsUsEquity2028SpecialHours()
{
var exchangeHours = MarketHoursDatabase.FromDataFolder()
.GetExchangeHours(Market.USA, null, SecurityType.Equity);

var holidays = new[]
{
new DateTime(2028, 1, 17),
new DateTime(2028, 2, 21),
new DateTime(2028, 4, 14),
new DateTime(2028, 5, 29),
new DateTime(2028, 6, 19),
new DateTime(2028, 7, 4),
new DateTime(2028, 9, 4),
new DateTime(2028, 11, 23),
new DateTime(2028, 12, 25)
};

foreach (var holiday in holidays)
{
Assert.IsTrue(exchangeHours.Holidays.Contains(holiday));
}
Assert.IsFalse(exchangeHours.Holidays.Contains(new DateTime(2028, 1, 1)));

var earlyCloseTime = new TimeSpan(13, 0, 0);
Assert.AreEqual(earlyCloseTime, exchangeHours.EarlyCloses[new DateTime(2028, 7, 3)]);
Assert.AreEqual(earlyCloseTime, exchangeHours.EarlyCloses[new DateTime(2028, 11, 24)]);
}

[TestCase("AUP", Market.COMEX, true)]
[TestCase("AA6", Market.NYMEX, true)]
[TestCase("6A", Market.CME, false)]
Expand Down