Skip to content
Merged
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
12 changes: 11 additions & 1 deletion Common/Securities/Future/FuturesListings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public static class FuturesListings
private static readonly Symbol _zw = Symbol.Create("ZW", SecurityType.Future, Market.CBOT);
private static readonly Symbol _tn = Symbol.Create("TN", SecurityType.Future, Market.CBOT);
private static readonly Symbol _aud = Symbol.Create("6A", SecurityType.Future, Market.CME);
private static readonly Symbol _gbp = Symbol.Create("6B", SecurityType.Future, Market.CME);
private static readonly Symbol _mxn = Symbol.Create("6M", SecurityType.Future, Market.CME);
private static readonly Symbol _jpy = Symbol.Create("6J", SecurityType.Future, Market.CME);
private static readonly Symbol _eur = Symbol.Create("6E", SecurityType.Future, Market.CME);
private static readonly Symbol _cad = Symbol.Create("6C", SecurityType.Future, Market.CME);

private static Dictionary<string, Func<DateTime, List<Symbol>>> _futuresListingRules = new Dictionary<string, Func<DateTime, List<Symbol>>>
{
Expand Down Expand Up @@ -73,7 +78,12 @@ public static class FuturesListings
t,
7,
new FuturesListingCycles(new[] { 3, 5, 7, 9, 12 }, 15)) },
{ "6A", t => QuarterlyContracts(_aud, t, 8) }
{ "6A", t => QuarterlyContracts(_aud, t, 8) },
{ "6B", t => QuarterlyContracts(_gbp, t, 8) },
{ "6M", t => QuarterlyContracts(_mxn, t, 8) },
{ "6J", t => QuarterlyContracts(_jpy, t, 8) },
{ "6E", t => QuarterlyContracts(_eur, t, 8) },
{ "6C", t => QuarterlyContracts(_cad, t, 8) },
};

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static class FuturesOptionsExpiryFunctions
private static readonly Symbol _jpu = Symbol.CreateCanonicalOption(Symbol.Create("6J", SecurityType.Future, Market.CME));
private static readonly Symbol _chu = Symbol.CreateCanonicalOption(Symbol.Create("6S", SecurityType.Future, Market.CME));
private static readonly Symbol _nzd = Symbol.CreateCanonicalOption(Symbol.Create("6N", SecurityType.Future, Market.CME));
private static readonly Symbol _mxn = Symbol.CreateCanonicalOption(Symbol.Create("6M", SecurityType.Future, Market.CME));
private static readonly Symbol _le = Symbol.CreateCanonicalOption(Symbol.Create("LE", SecurityType.Future, Market.CME));
private static readonly Symbol _he = Symbol.CreateCanonicalOption(Symbol.Create("HE", SecurityType.Future, Market.CME));
private static readonly Symbol _lbr = Symbol.CreateCanonicalOption(Symbol.Create("LBR", SecurityType.Future, Market.CME));
Expand Down Expand Up @@ -97,6 +98,7 @@ public static class FuturesOptionsExpiryFunctions
{ _jpu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_jpu.Underlying, expiryMonth) },
{ _chu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_chu.Underlying, expiryMonth) },
{ _nzd, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_nzd.Underlying, expiryMonth) },
{ _mxn, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_mxn.Underlying, expiryMonth) },
{ _le, expiryMonth => FirstFridayOfContractMonth(_le.Underlying, expiryMonth) },
{ _he, expiryMonth => TenthBusinessDayOfContractMonth(_he.Underlying, expiryMonth) },
{ _lbr, expiryMonth => LastBusinessDayInPrecedingMonthFromContractMonth(_lbr.Underlying, expiryMonth) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ public static class FuturesOptionsUnderlyingMapper
{ "GC", (d, _) => ContractMonthEvenOddMonth(d, false) },

// CME
{ "6A", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6A", SecurityType.Future, Market.CME), d, ld.Value) }
{ "6A", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6A", SecurityType.Future, Market.CME), d, ld.Value) },
{ "6B", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6B", SecurityType.Future, Market.CME), d, ld.Value) },
{ "6M", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6M", SecurityType.Future, Market.CME), d, ld.Value) },
{ "6J", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6J", SecurityType.Future, Market.CME), d, ld.Value) },
{ "6E", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6E", SecurityType.Future, Market.CME), d, ld.Value) },
{ "6C", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6C", SecurityType.Future, Market.CME), d, ld.Value) },
};

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,27 @@ public void ExpiryFunctionsReturnExpectedResults(string futureTicker, string mar
[TestCase("6N", Market.CME, "202511", "20251107", "20251215")]
[TestCase("6N", Market.CME, "202512", "20251205", "20251215")]
[TestCase("6N", Market.CME, "202601", "20260109", "20260316")]
[TestCase("6N", Market.CME, "202601", "20260109", "20260316")]
[TestCase("6N", Market.CME, "202602", "20260206", "20260316")]
[TestCase("6N", Market.CME, "202604", "20260403", "20260615")]
[TestCase("6B", Market.CME, "202601", "20260109", "20260316")]
[TestCase("6B", Market.CME, "202602", "20260206", "20260316")]
[TestCase("6B", Market.CME, "202603", "20260306", "20260316")]
[TestCase("6C", Market.CME, "202601", "20260109", "20260317")]
[TestCase("6C", Market.CME, "202602", "20260206", "20260317")]
[TestCase("6C", Market.CME, "202603", "20260306", "20260317")]
[TestCase("6J", Market.CME, "202601", "20260109", "20260316")]
[TestCase("6J", Market.CME, "202602", "20260206", "20260316")]
[TestCase("6J", Market.CME, "202603", "20260306", "20260316")]
[TestCase("6S", Market.CME, "202601", "20260109", "20260316")]
[TestCase("6S", Market.CME, "202602", "20260206", "20260316")]
[TestCase("6S", Market.CME, "202603", "20260306", "20260316")]
[TestCase("6E", Market.CME, "202601", "20260109", "20260316")]
[TestCase("6E", Market.CME, "202602", "20260206", "20260316")]
[TestCase("6E", Market.CME, "202603", "20260306", "20260316")]
[TestCase("6M", Market.CME, "202604", "20260403", "20260615")]
[TestCase("6M", Market.CME, "202605", "20260508", "20260615")]
[TestCase("6M", Market.CME, "202606", "20260605", "20260615")]
[TestCase("6A", Market.CME, "202601", "20260109", "20260316", Description = "Quarterly contract : Mar")]
[TestCase("6A", Market.CME, "202602", "20260206", "20260316", Description = "Quarterly contract : Mar")]
[TestCase("6A", Market.CME, "202603", "20260306", "20260316", Description = "Quarterly contract : Mar")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,23 @@ public class FuturesOptionsUnderlyingMapperTests
[TestCase("6A", Market.CME, 2021, 10, 05, 2021, 12, 13, false)]
[TestCase("6A", Market.CME, 2021, 11, 05, 2021, 12, 13, false)]
[TestCase("6A", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
[TestCase("6B", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
[TestCase("6B", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
[TestCase("6C", Market.CME, 2025, 09, 05, 2025, 09, 16, false)]
[TestCase("6C", Market.CME, 2025, 12, 05, 2025, 12, 16, false)]
[TestCase("6E", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
[TestCase("6E", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
[TestCase("6J", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
[TestCase("6J", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
[TestCase("6S", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
[TestCase("6S", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
[TestCase("6N", Market.CME, 2021, 01, 09, 2021, 03, 15, false)]
[TestCase("6B", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]
[TestCase("6B", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
[TestCase("6B", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
[TestCase("6C", Market.CME, 2021, 01, 09, 2021, 03, 16, false)]
[TestCase("6C", Market.CME, 2021, 09, 05, 2021, 09, 14, false)]
[TestCase("6C", Market.CME, 2021, 12, 05, 2021, 12, 14, false)]
[TestCase("6E", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
[TestCase("6E", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
[TestCase("6E", Market.CME, 2021, 01, 09, 2021, 03, 15, false)]
[TestCase("6M", Market.CME, 2021, 04, 03, 2021, 06, 14, false)]
[TestCase("6J", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
[TestCase("6J", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
[TestCase("6J", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]
[TestCase("6S", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
[TestCase("6S", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
[TestCase("6S", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]
[TestCase("ZC", Market.CBOT, 2031, 12, 26, 2031, 12, 26, true)]
[TestCase("ZS", Market.CBOT, 2034, 12, 22, 2034, 12, 22, true)]
[TestCase("ZW", Market.CBOT, 2036, 12, 26, 2036, 12, 26, true)]
Expand Down