Front Month Determination

How does the API determine front month status for a particular contract? Is it based on a fixed time to expiration?

As an example, I just queried contract maturities for Chicago wheat (ZW). The API is suggesting the July expiration for the front month. CME Group’s contract summary webpage is suggesting the September contract, likely because of daily relative volume.

In case it helps others:

I prefer to maintain a universe of tradable product codes (e.g. GC, 6C, HE) and update a list of highest-volume contract codes during strategy initialization to serve as front month contracts. This can be done by hand using each CME Group product webpage, but it is time consuming and clunky.

The Tradovate API flag isFront from the contractmaturity/deps endpoint gets you close, but it uses the nearest maturity, not necessarily the most active. Running this query for the three examples from before yields [GCQ1, 6CQ1, HEQ1]. The desired result is [GCZ1, 6CU1, HEV1].

The best way I’ve found to get this is querying CME Group endpoints. Performing a GET request at:
returns the top 500 Globex futures products by volume, where you can find the corresponding product "id"s [437, 48, 19].

After, you can perform a GET request at:<PRODUCT_ID>&contractsNumber=1&venue=G&type=VOLUME where <PRODUCT_ID> is the product ID you want to find.

This returns the highest volume Globex contract code for the product. Running this for each ID above gives me [GCZ1, 6CU1, HEV1].

It would be nice if there were a method to generate this same result within the Tradovate API; maybe I just haven’t found it. If you’re writing production code, it is probably not acceptable to use these undocumented CME Group request URLs.

1 Like