Skip to content

Add 1-Ounce Gold and Micro Ultra Treasury futures - #9692

Open
0xpinara wants to merge 1 commit into
QuantConnect:masterfrom
0xpinara:feature-9622-1oz-mtn-mwn-futures
Open

Add 1-Ounce Gold and Micro Ultra Treasury futures#9692
0xpinara wants to merge 1 commit into
QuantConnect:masterfrom
0xpinara:feature-9622-1oz-mtn-mwn-futures

Conversation

@0xpinara

Copy link
Copy Markdown
Contributor

Description

This adds three CME futures so AddFuture() can find them:

  • 1-Ounce Gold (1OZ, COMEX)
  • Micro Ultra 10-Year U.S. Treasury Note (MTN, CBOT)
  • Micro Ultra U.S. Treasury Bond (MWN, CBOT)

Each one gets a ticker constant, an expiry function, a symbol-properties row,
and a market-hours entry.

I found two things that are different from the issue:

  1. 1OZ does not use the same calendar as GC/MGC. Trading stops on the third
    last business day of the month before the contract month. I checked 8 real
    expiry dates from CME and they all match, including the Thanksgiving one.
    I followed the same pattern already used for Henry Hub Last-day Financial (HH).

  2. MWN is not the 10-Year Note micro. It is the Ultra Bond micro. The Note
    micro is MTN. The tick sizes are different too (1/64 for the Note, 1/32 for
    the Bond). I added both so it is correct either way. Happy to remove one if
    you only want one.

I left QNDX out. The issue says Spot-Quoted futures do not follow the
quarterly-roll model and need a design decision first. I can do it in a
follow-up PR.

Related Issue

Partially addresses #9622.

Motivation and Context

These tickers are not registered anywhere in LEAN, so users cannot add them at
all. This unblocks live trading and live IB data for them.

Requires Documentation Change

Yes, the list of supported futures should get these three new tickers.

How Has This Been Tested?

I added new test cases in FuturesExpiryFunctionsTests and new rows in
FuturesExpiryFunctionsTestData.xml. FuturesExpiryFunctionsTests passes
203/203 locally.

I could not run MarketHoursDatabaseTests or SymbolPropertiesDatabaseTests
on my machine. They crash during teardown with a Python GIL error, and this
also happens on unmodified master, so I do not think it is from my change.

Some 1OZ test rows use off-cycle months on purpose, to test that it rolls
forward to the next Feb/Apr/Jun/Aug/Oct/Dec contract.

One note on the diff: the market-hours JSON looks like it changed a lot, but I
parsed the file before and after and only 3 entries were added. No existing
entry was changed. The big diff is just git lining up the wrong blocks, because
the new entries look almost the same as their neighbors.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant