Skip to content
All library documents

Using CFTC Trader Positions as Futures Sentiment Features

Article Machine Learning for Trading

Summary

This guide introduces the public CFTC Commitment of Traders reports as a source of weekly futures positioning data. It distinguishes the Traders in Financial Futures report, which categorizes participants such as dealers, asset managers, and leveraged money, from the disaggregated report used for commodity futures, with categories including commercials, managed money, and swap dealers. Product-level files contain report dates, open interest, and trader long, short, and net positions. The material points to positioning analysis, z-scores, contrarian signals, and futures strategy features as possible uses, but it does not present a tested trading rule or performance evidence.

The central implementation caution is release timing. Each snapshot describes positions as of Tuesday but is not published until Friday afternoon; the guide recommends a more conservative six-calendar-day availability lag for daily-bar backtests. This matters for preventing lookahead bias when aligning reports to market data. Columns differ between financial and commodity reports, so combined data needs to accommodate those schema differences. The document explains access and storage conventions, but gives no assessment of signal strength, category interpretation, or whether positioning features improve returns.

Key ideas

  • CFTC reports provide weekly futures positions grouped by trader category.
  • Financial futures and commodity futures use different report types and category names.
  • Position measures include long, short, net, open interest, product, and report date.
  • Backtests should account for the gap between the Tuesday snapshot and Friday release.
  • The guide identifies possible feature uses but does not establish a profitable positioning strategy.

Tags

Full text
# Futures Positioning: CFTC Commitment of Traders


# Futures Positioning: CFTC Commitment of Traders

Weekly positioning snapshots (Tuesday; released Friday at 3:30 PM ET) for
CME / ICE / CBOT futures, broken down by trader category. Free and public
domain. Used in Ch4 NB 10 for sentiment/positioning features and in
Ch8 / Ch16 for futures strategy inputs.

## Dataset

| Report type | Trader categories | Products |
| --- | --- | --- |
| TFF (Traders in Financial Futures) | Dealers, Asset Managers, Leveraged Money | Financial futures (ES, NQ, 6E, ZN, …) |
| Disaggregated | Commercials, Managed Money, Swap Dealers | Commodity futures (CL, GC, ZC, …) |

Product mapping + report-type dispatch live in the `ml4t.data.cot` library
(`ml4t.data.cot.PRODUCT_MAPPINGS`). The downloader here wraps that library
and persists one parquet per product to the local data store.

## Download

```bash
# Default: all products in PRODUCT_MAPPINGS, 2020 through current year
uv run python data/futures/positioning/cot_download.py

# Subset of products + longer history
uv run python data/futures/positioning/cot_download.py --products ES,NQ,CL,GC --start-year 2010

# Override output root
uv run python data/futures/positioning/cot_download.py --data-path /tmp/ml4t-data
```

## Directory Layout

```
$ML4T_DATA_PATH/futures/positioning/cot/
└── {PRODUCT}.parquet    # one parquet per product code (e.g., ES.parquet)
```

## Schema

Columns vary by report type but always include:

| Column | Notes |
| --- | --- |
| `product` | Exchange product code (ES, CL, GC, …) |
| `report_type` | CFTC report that produced the row |
| `report_date` | Tuesday snapshot date |
| `open_interest` | Total open interest |

Per-trader long/short/net columns by report type:

- **Financial (TFF)**: `dealer_long/short/net`, `asset_mgr_long/short/net`, `lev_money_long/short/net`
- **Commodity (disaggregated)**: `commercial_long/short/net`, `managed_money_long/short/net`, `swap_long/short/net`

## Loading

```python
from data import load_cot, list_cot_products

# Everything available locally
df = load_cot()

# Subset + date filter
df = load_cot(products=["ES", "NQ"], start_date="2020-01-01", end_date="2024-12-31")

# Enumerate what's been downloaded
list_cot_products()  # -> ['CL', 'ES', 'GC', 'NQ', ...]
```

`load_cot()` uses `diagonal_relaxed` concat so financial and commodity
products can be combined in one frame despite their different schemas.

## Release Lag

CFTC publishes reports Friday at 3:30 PM ET; the snapshot is as-of
**Tuesday** of the same week (3-day lag). For daily-bar backtests a
conservative +6 calendar-day availability lag from Tuesday is standard.

## Consumers

- **Ch4 NB 10** — positioning analysis, z-scores, contrarian signals
- **Ch8** — futures_features.py (positioning feature family)
- **Ch16** — futures strategies using CoT signals

Shown in full with attribution under the source's licence. Licence: MIT

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.