Skip to content

Commit 7257376

Browse files
authored
fix: several Futures Currencies: 6B, 6M, 6J, 6E, 6C (#9155)
1 parent 37ccee4 commit 7257376

File tree

5 files changed

+57
-12
lines changed

5 files changed

+57
-12
lines changed

Common/Securities/Future/FuturesListings.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public static class FuturesListings
3737
private static readonly Symbol _zw = Symbol.Create("ZW", SecurityType.Future, Market.CBOT);
3838
private static readonly Symbol _tn = Symbol.Create("TN", SecurityType.Future, Market.CBOT);
3939
private static readonly Symbol _aud = Symbol.Create("6A", SecurityType.Future, Market.CME);
40+
private static readonly Symbol _gbp = Symbol.Create("6B", SecurityType.Future, Market.CME);
41+
private static readonly Symbol _mxn = Symbol.Create("6M", SecurityType.Future, Market.CME);
42+
private static readonly Symbol _jpy = Symbol.Create("6J", SecurityType.Future, Market.CME);
43+
private static readonly Symbol _eur = Symbol.Create("6E", SecurityType.Future, Market.CME);
44+
private static readonly Symbol _cad = Symbol.Create("6C", SecurityType.Future, Market.CME);
4045

4146
private static Dictionary<string, Func<DateTime, List<Symbol>>> _futuresListingRules = new Dictionary<string, Func<DateTime, List<Symbol>>>
4247
{
@@ -73,7 +78,12 @@ public static class FuturesListings
7378
t,
7479
7,
7580
new FuturesListingCycles(new[] { 3, 5, 7, 9, 12 }, 15)) },
76-
{ "6A", t => QuarterlyContracts(_aud, t, 8) }
81+
{ "6A", t => QuarterlyContracts(_aud, t, 8) },
82+
{ "6B", t => QuarterlyContracts(_gbp, t, 8) },
83+
{ "6M", t => QuarterlyContracts(_mxn, t, 8) },
84+
{ "6J", t => QuarterlyContracts(_jpy, t, 8) },
85+
{ "6E", t => QuarterlyContracts(_eur, t, 8) },
86+
{ "6C", t => QuarterlyContracts(_cad, t, 8) },
7787
};
7888

7989
/// <summary>

Common/Securities/FutureOption/FuturesOptionsExpiryFunctions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public static class FuturesOptionsExpiryFunctions
5050
private static readonly Symbol _jpu = Symbol.CreateCanonicalOption(Symbol.Create("6J", SecurityType.Future, Market.CME));
5151
private static readonly Symbol _chu = Symbol.CreateCanonicalOption(Symbol.Create("6S", SecurityType.Future, Market.CME));
5252
private static readonly Symbol _nzd = Symbol.CreateCanonicalOption(Symbol.Create("6N", SecurityType.Future, Market.CME));
53+
private static readonly Symbol _mxn = Symbol.CreateCanonicalOption(Symbol.Create("6M", SecurityType.Future, Market.CME));
5354
private static readonly Symbol _le = Symbol.CreateCanonicalOption(Symbol.Create("LE", SecurityType.Future, Market.CME));
5455
private static readonly Symbol _he = Symbol.CreateCanonicalOption(Symbol.Create("HE", SecurityType.Future, Market.CME));
5556
private static readonly Symbol _lbr = Symbol.CreateCanonicalOption(Symbol.Create("LBR", SecurityType.Future, Market.CME));
@@ -97,6 +98,7 @@ public static class FuturesOptionsExpiryFunctions
9798
{ _jpu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_jpu.Underlying, expiryMonth) },
9899
{ _chu, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_chu.Underlying, expiryMonth) },
99100
{ _nzd, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_nzd.Underlying, expiryMonth) },
101+
{ _mxn, expiryMonth => SecondFridayBeforeThirdWednesdayOfContractMonth(_mxn.Underlying, expiryMonth) },
100102
{ _le, expiryMonth => FirstFridayOfContractMonth(_le.Underlying, expiryMonth) },
101103
{ _he, expiryMonth => TenthBusinessDayOfContractMonth(_he.Underlying, expiryMonth) },
102104
{ _lbr, expiryMonth => LastBusinessDayInPrecedingMonthFromContractMonth(_lbr.Underlying, expiryMonth) },

Common/Securities/FutureOption/FuturesOptionsUnderlyingMapper.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ public static class FuturesOptionsUnderlyingMapper
6363
{ "GC", (d, _) => ContractMonthEvenOddMonth(d, false) },
6464

6565
// CME
66-
{ "6A", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6A", SecurityType.Future, Market.CME), d, ld.Value) }
66+
{ "6A", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6A", SecurityType.Future, Market.CME), d, ld.Value) },
67+
{ "6B", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6B", SecurityType.Future, Market.CME), d, ld.Value) },
68+
{ "6M", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6M", SecurityType.Future, Market.CME), d, ld.Value) },
69+
{ "6J", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6J", SecurityType.Future, Market.CME), d, ld.Value) },
70+
{ "6E", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6E", SecurityType.Future, Market.CME), d, ld.Value) },
71+
{ "6C", (d, ld) => ContractMonthSerialLookupRule(Symbol.Create("6C", SecurityType.Future, Market.CME), d, ld.Value) },
6772
};
6873

6974
/// <summary>

Tests/Common/Securities/FutureOption/FuturesOptionsExpiryFunctionsTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,27 @@ public void ExpiryFunctionsReturnExpectedResults(string futureTicker, string mar
107107
[TestCase("6N", Market.CME, "202511", "20251107", "20251215")]
108108
[TestCase("6N", Market.CME, "202512", "20251205", "20251215")]
109109
[TestCase("6N", Market.CME, "202601", "20260109", "20260316")]
110+
[TestCase("6N", Market.CME, "202601", "20260109", "20260316")]
111+
[TestCase("6N", Market.CME, "202602", "20260206", "20260316")]
112+
[TestCase("6N", Market.CME, "202604", "20260403", "20260615")]
113+
[TestCase("6B", Market.CME, "202601", "20260109", "20260316")]
114+
[TestCase("6B", Market.CME, "202602", "20260206", "20260316")]
115+
[TestCase("6B", Market.CME, "202603", "20260306", "20260316")]
116+
[TestCase("6C", Market.CME, "202601", "20260109", "20260317")]
117+
[TestCase("6C", Market.CME, "202602", "20260206", "20260317")]
118+
[TestCase("6C", Market.CME, "202603", "20260306", "20260317")]
119+
[TestCase("6J", Market.CME, "202601", "20260109", "20260316")]
120+
[TestCase("6J", Market.CME, "202602", "20260206", "20260316")]
121+
[TestCase("6J", Market.CME, "202603", "20260306", "20260316")]
122+
[TestCase("6S", Market.CME, "202601", "20260109", "20260316")]
123+
[TestCase("6S", Market.CME, "202602", "20260206", "20260316")]
124+
[TestCase("6S", Market.CME, "202603", "20260306", "20260316")]
125+
[TestCase("6E", Market.CME, "202601", "20260109", "20260316")]
126+
[TestCase("6E", Market.CME, "202602", "20260206", "20260316")]
127+
[TestCase("6E", Market.CME, "202603", "20260306", "20260316")]
128+
[TestCase("6M", Market.CME, "202604", "20260403", "20260615")]
129+
[TestCase("6M", Market.CME, "202605", "20260508", "20260615")]
130+
[TestCase("6M", Market.CME, "202606", "20260605", "20260615")]
110131
[TestCase("6A", Market.CME, "202601", "20260109", "20260316", Description = "Quarterly contract : Mar")]
111132
[TestCase("6A", Market.CME, "202602", "20260206", "20260316", Description = "Quarterly contract : Mar")]
112133
[TestCase("6A", Market.CME, "202603", "20260306", "20260316", Description = "Quarterly contract : Mar")]

Tests/Common/Securities/FutureOption/FuturesOptionsUnderlyingMapperTests.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,23 @@ public class FuturesOptionsUnderlyingMapperTests
3939
[TestCase("6A", Market.CME, 2021, 10, 05, 2021, 12, 13, false)]
4040
[TestCase("6A", Market.CME, 2021, 11, 05, 2021, 12, 13, false)]
4141
[TestCase("6A", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
42-
[TestCase("6B", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
43-
[TestCase("6B", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
44-
[TestCase("6C", Market.CME, 2025, 09, 05, 2025, 09, 16, false)]
45-
[TestCase("6C", Market.CME, 2025, 12, 05, 2025, 12, 16, false)]
46-
[TestCase("6E", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
47-
[TestCase("6E", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
48-
[TestCase("6J", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
49-
[TestCase("6J", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
50-
[TestCase("6S", Market.CME, 2025, 09, 05, 2025, 09, 15, false)]
51-
[TestCase("6S", Market.CME, 2025, 12, 05, 2025, 12, 15, false)]
42+
[TestCase("6N", Market.CME, 2021, 01, 09, 2021, 03, 15, false)]
43+
[TestCase("6B", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]
44+
[TestCase("6B", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
45+
[TestCase("6B", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
46+
[TestCase("6C", Market.CME, 2021, 01, 09, 2021, 03, 16, false)]
47+
[TestCase("6C", Market.CME, 2021, 09, 05, 2021, 09, 14, false)]
48+
[TestCase("6C", Market.CME, 2021, 12, 05, 2021, 12, 14, false)]
49+
[TestCase("6E", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
50+
[TestCase("6E", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
51+
[TestCase("6E", Market.CME, 2021, 01, 09, 2021, 03, 15, false)]
52+
[TestCase("6M", Market.CME, 2021, 04, 03, 2021, 06, 14, false)]
53+
[TestCase("6J", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
54+
[TestCase("6J", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
55+
[TestCase("6J", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]
56+
[TestCase("6S", Market.CME, 2021, 09, 05, 2021, 09, 13, false)]
57+
[TestCase("6S", Market.CME, 2021, 12, 05, 2021, 12, 13, false)]
58+
[TestCase("6S", Market.CME, 2021, 02, 06, 2021, 03, 15, false)]
5259
[TestCase("ZC", Market.CBOT, 2031, 12, 26, 2031, 12, 26, true)]
5360
[TestCase("ZS", Market.CBOT, 2034, 12, 22, 2034, 12, 22, true)]
5461
[TestCase("ZW", Market.CBOT, 2036, 12, 26, 2036, 12, 26, true)]

0 commit comments

Comments
 (0)