跳至正文
返回文库全部文档

将CFTC交易者持仓用作期货情绪特征

文章 《交易机器学习》

总结

本指南介绍公开的CFTC交易者持仓报告,将其作为每周期货持仓数据来源。报告分为金融期货交易者报告和商品期货分类报告:前者按交易商、资产管理机构和杠杆资金等类别划分参与者;后者包含商业交易者、管理资金和掉期交易商等类别。产品级文件包含报告日期、未平仓合约量,以及交易者的多头、空头和净头寸。本文将持仓分析、z分数、反向信号和期货策略特征列为可能的用途,但没有提供经过测试的交易规则或表现证据。

实施时最需要注意的是发布时间。每份快照反映截至周二的持仓,但要到周五下午才会发布;本指南建议在日线回测中采用更保守的六个日历日可用性延迟。这有助于在将报告与市场数据对齐时防止前视偏差。金融期货报告和商品期货报告的列有所不同,因此合并数据时必须兼容这些模式差异。本文解释了数据访问和存储惯例,但没有评估信号强度、类别解读或持仓特征能否改善收益。

核心观点

  • CFTC报告按交易者类别提供每周期货持仓数据。
  • 金融期货和商品期货使用不同的报告类型和类别名称。
  • 持仓指标包括多头、空头、净头寸、未平仓合约量、产品和报告日期。
  • 回测应考虑周二快照与周五发布之间的时间差。
  • 本指南指出了特征的可能用途,但并未证明持仓策略能够盈利。

标签

全文
# 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

在遵守原作品许可的前提下,附作者信息全文展示。 许可协议: MIT

此摘要由 Stratmill 研究智能体根据原文撰写,并非原文副本。