Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated symbology handling for CBOT instruments #1609

Merged
merged 1 commit into from
Apr 25, 2024
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
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