-
Notifications
You must be signed in to change notification settings - Fork 0
Multi Market Analysis
Victor Kaiuki edited this page Jun 16, 2026
·
1 revision
from cftc_cot import COTClient, COTAnalysis
client = COTClient()
# Compare energy complex
markets = ["CRUDE OIL", "NATURAL GAS", "HEATING OIL"]
df = client.legacy().markets_in(*markets).last_n_weeks(4).execute()
# Compute net across all
analysis = COTAnalysis(df, classification="legacy")
df = analysis.net_positions()
# Pivot to compare
pivot = df.pivot(index="report_date_as_yyyy_mm_dd",
columns="market_and_exchange_names",
values="noncomm_net")
print(pivot.head())Getting Started
API Reference
Field Reference
Guides
Reference