Skip to content

Commit

Permalink
Add hang seng future and index support (#8499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Molinero authored Jan 3, 2025
1 parent 57ce695 commit af2043d
Show file tree
Hide file tree
Showing 7 changed files with 853 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Common/Securities/Future/Futures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,12 @@ public static class Indices
/// <returns>The symbol</returns>
public const string BseSensex = "SENSEX";

/// <summary>
/// Hang Seng Index
/// </summary>
/// <returns>The symbol</returns>
public const string HangSeng = "HSI";

/// <summary>
/// Micro E-mini S&amp;P 500 Index Futures
/// </summary>
Expand Down
18 changes: 18 additions & 0 deletions Common/Securities/Future/FuturesExpiryFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,24 @@ public static Func<DateTime, DateTime> FuturesExpiryFunction(Symbol symbol)
})
},

// HSI Index Futures:https://www.hkex.com.hk/Products/Listed-Derivatives/Equity-Index/Hang-Seng-Index-(HSI)/Hang-Seng-Index-Futures?sc_lang=en#&product=HSI
{Symbol.Create(Futures.Indices.HangSeng, SecurityType.Future, Market.HKFE), (time =>
{
// Short-dated Futures: Spot, next calendar month & next two calendar quarter months; and Long-dated Futures: the following 5 December months

// The Business Day immediately preceding the last Business Day of the Contract Month
var lastDay = new DateTime(time.Year, time.Month, DateTime.DaysInMonth(time.Year, time.Month));
var priorBusinessDay = lastDay.AddDays(-1);

var holidays = FuturesExpiryUtilityFunctions.GetHolidays(Market.HKFE, Futures.Indices.HangSeng);
while (holidays.Contains(priorBusinessDay) || !priorBusinessDay.IsCommonBusinessDay())
{
priorBusinessDay = priorBusinessDay.AddDays(-1);
}
return priorBusinessDay.Add(new TimeSpan(16, 0, 0));
})
},

// MSCI Europe Net Total Return (USD) Futures: https://www.theice.com/products/71512951/MSCI-Europe-NTR-Index-Future-USD & https://www.theice.com/publicdocs/futures_us/exchange_notices/ICE_Futures_US_2022_TRADING_HOLIDAY_CALENDAR_20211118.pdf
{Symbol.Create(Futures.Indices.MSCIEuropeNTR, SecurityType.Future, Market.NYSELIFFE), (time =>
{
Expand Down
3 changes: 2 additions & 1 deletion Common/Securities/Index/IndexSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static class IndexSymbol
{ "VIX", Market.CBOE },
{ "SPXW", Market.CBOE },
{ "NQX", "NASDAQ" },
{ "VIXW", Market.CBOE }
{ "VIXW", Market.CBOE },
{ "HSI", Market.HKFE }
};

/// <summary>
Expand Down
Loading

0 comments on commit af2043d

Please sign in to comment.