Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Weekly futures positioning by trader category for building commodities, rates, and speculative-position monitors.
From source to product signal
The COT reports break down open interest for futures markets with enough large traders. Start with one contract in the legacy combined dataset. Categories are regulatory, not strategy labels, and Tuesday positions are published later in the week.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://publicreporting.cftc.gov/resource/jun7-fc8e.json",
params={
"$limit": 20,
"$order": "report_date_as_yyyy_mm_dd DESC",
"contract_market_name": "GOLD",
},
timeout=30,
)
response.raise_for_status()
cot = pd.DataFrame(response.json())
print(cot[[
"report_date_as_yyyy_mm_dd",
"contract_market_name",
"open_interest_all",
"noncomm_positions_long_all",
"noncomm_positions_short_all",
]].head())Test a useful signal
Test whether weekly COT records can power a bounded positioning monitor.
Commodity Futures Trading Commission is a government source. Last verified 2026-08-18. Temporal coverage: 1986-present weekly reports.