Skip to content

Common Patterns

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

Common Patterns

1. Latest Crude Oil Net Positions

from cftc_cot import COTClient, COTAnalysis
client = COTClient()
df = client.latest("legacy", "CRUDE OIL")
analysis = COTAnalysis(df, "legacy")
print(analysis.net_positions()[['noncomm_net', 'comm_net']])

2. Weekly Soybean Managed Money Trend

from cftc_cot import COTClient
client = COTClient()
df = client.history("disaggregated", "SOYBEANS", weeks=52)
print(df[['report_date_as_yyyy_mm_dd', 'm_money_positions_long_all']])

Clone this wiki locally