Skip to content

Commit

Permalink
Remove outdated symbology handling for CBOT instruments (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsmb7z authored Apr 25, 2024
1 parent e39591a commit d3149c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -578,19 +578,11 @@ def instrument_id_to_ib_contract_simplified_symbology( # noqa: C901 (too comple
)
elif instrument_id.venue.value in VENUES_FUT:
if m := RE_FUT.match(instrument_id.symbol.value):
if instrument_id.venue.value == "CBOT":
# IB still using old symbology after merger of CBOT with CME
return IBContract(
secType="FUT",
exchange=instrument_id.venue.value,
localSymbol=f"{m['symbol'].ljust(4)} {FUTURES_CODE_TO_MONTH[m['month']]} {m['year']}",
)
else:
return IBContract(
secType="FUT",
exchange=instrument_id.venue.value,
localSymbol=f"{m['symbol']}{m['month']}{m['year'][-1]}",
)
return IBContract(
secType="FUT",
exchange=instrument_id.venue.value,
localSymbol=f"{m['symbol']}{m['month']}{m['year'][-1]}",
)
elif m := RE_IND.match(instrument_id.symbol.value):
return IBContract(
secType="CONTFUT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(IBContract(secType="CONTFUT", exchange="SNFE", symbol="SPI"), "SPI.SNFE"),
(IBContract(secType="FUT", exchange="CME", localSymbol="ESH3"), "ESH23.CME"),
(IBContract(secType="FUT", exchange="CME", localSymbol="M6EH3"), "M6EH23.CME"),
(IBContract(secType="FUT", exchange="CBOT", localSymbol="MYM JUN 23"), "MYMM23.CBOT"),
(IBContract(secType="FUT", exchange="CBOT", localSymbol="MYMM3"), "MYMM23.CBOT"),
(IBContract(secType="FUT", exchange="NYMEX", localSymbol="MCLV3"), "MCLV23.NYMEX"),
(IBContract(secType="FUT", exchange="SNFE", localSymbol="APH3"), "APH23.SNFE"),
(IBContract(secType="FOP", exchange="NYBOT", localSymbol="EX2G3 P4080"), "EX2G23P4080.NYBOT"),
Expand All @@ -75,7 +75,7 @@
(IBContract(secType="OPT", exchange="SMART", localSymbol="AAPL 230217P00155000"), "AAPL 230217P00155000=OPT.SMART"),
(IBContract(secType="FUT", exchange="CME", localSymbol="ESH3"), "ESH3=FUT.CME"),
(IBContract(secType="FUT", exchange="CME", localSymbol="M6EH3"), "M6EH3=FUT.CME"),
(IBContract(secType="FUT", exchange="CBOT", localSymbol="MYM JUN 23"), "MYM JUN 23=FUT.CBOT"),
(IBContract(secType="FUT", exchange="CBOT", localSymbol="MYMM3"), "MYMM3=FUT.CBOT"),
(IBContract(secType="FUT", exchange="NYMEX", localSymbol="MCLV3"), "MCLV3=FUT.NYMEX"),
(IBContract(secType="FUT", exchange="SNFE", localSymbol="APH3"), "APH3=FUT.SNFE"),
(IBContract(secType="FOP", exchange="NYBOT", localSymbol="EX2G3 P4080"), "EX2G3 P4080=FOP.NYBOT"),
Expand Down

0 comments on commit d3149c5

Please sign in to comment.