COT Contrarian Detector covers step one of Jason Shapiro’s contrarian method: finding markets where large speculators are crowded onto one side. A Python script fetches the weekly legacy Commitment of Traders report for each market from the Financial Modeling Prep API, computes a COT Index over 156 weeks and over 26 weeks, and labels each market CROWDED_LONG, CROWDED_SHORT or NEUTRAL.
The skill detects crowding only. It states that crowding alone is not a trade signal, and it points the agent to a methodology reference for the manual steps that follow. Output is for research and is not investment advice.
What You Get
- A ranked table of markets with the 3-year COT Index and the 26-week index
- CROWDED_LONG (index 90 or above) and CROWDED_SHORT (index 10 or below) lists
- A skipped markets list that names why a market had too little history
- A JSON file with run context, data provenance and results, plus a Markdown report
Common Use Cases
- Weekly review of which futures markets have crowded speculators
- Checking positioning in gold, the dollar, bonds or equity index futures
- Producing the first report that the contrarian setup gate skill reads
- Explaining a single COT Index number with the calculation reference
What Makes It Unique
It limits itself to detection and says so: the guardrails forbid suggesting an entry from crowding alone, and the manual steps (news failure, price action, entry, exit) are laid out in a reference file. Markets are never silently dropped, the JSON records when the data was retrieved and how old the market data is, and the report notes the Friday publication cadence and its three to nine day lag.
Under The Hood
The agent runs a Python script that calls the Financial Modeling Prep Commitment of Traders endpoints over the network, one call per market, using the user’s API key from the FMP_API_KEY environment variable or a command line option. The key is sent in a request header and redacted from error output. COT endpoints need a paid FMP plan. The script writes a JSON file and a Markdown report into an output folder. The agent reads reference files for methodology and may use web search when walking through the later manual steps.