Skip to content

Quick Start

Victor Kaiuki edited this page Jun 16, 2026 · 1 revision

Quick Start

from cftc_cot import COTClient, COTAnalysis

# Initialize
client = COTClient()

# Get 52 weeks of Crude Oil data
df = client.legacy().market("Crude Oil").last_n_weeks(52).execute()

# Compute net positions
analysis = COTAnalysis(df, classification="legacy")
df = analysis.net_positions()

print(df[['report_date_as_yyyy_mm_dd', 'noncomm_net']].head())

Clone this wiki locally