Skip to content
SkillScript-led1,974 tokens in use

COT Contrarian Detector

Fetches Commitment of Traders data for CFTC futures markets and flags crowded large-speculator positioning with a 3-year and a 26-week COT Index.

7,426 stars on the repository MIT Licensetradermonty/claude-trading-skills · skills/cot-contrarian-detector

Skill label

measured from its files

What installing COT Contrarian Detector costs

168tokens idle
1,974tokens in use
6,694tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Script-led

Script-ledMixedModel-led

Most of this skill is scripts, so it behaves much the same whichever model runs it.

This describes the skill's structure, how much of it is scripts. It does not say how well it works. Scripts: scripts/cot_index.py, scripts/fmp_client.py, scripts/screen_cot_crowding.py.

Touches

shelldetectednetworkdetectedwrites filesdetectedcredentialsdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Good
  • Frontmatter12/15
  • Structure25/25
  • Examples9/15
  • Output10/15
  • Size13/15
  • Resources10/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Good
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 61
  • Reaches the network−10

    does this on the machine, and the frontmatter does not say so

    scripts/fmp_client.py, line 33
  • Reads credentials−15

    does this on the machine, and the frontmatter does not say so

    scripts/fmp_client.py, line 156
  • Writes files−8

    does this on the machine, and the frontmatter does not say so

    scripts/screen_cot_crowding.py, line 406

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity100
  • Maintenance52
  • Community68
  • Maturity36
  • Momentum40

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.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers