Cot Contrarian Detector logo

Cot Contrarian Detector

CommunityPopular
tradermonty
cot-contrarian-detector

Detect crowded speculative positioning in CFTC futures markets (COT report analysis) to find contrarian setups using Jason Shapiro's methodology. Screens large-speculator ("non-commercial") net positioning across 65 futures markets (indices, rates, FX, metals, energy, crypto) via the FMP Commitment of Traders API, computes a 3-year and 26-week COT Index per market, and classifies extremes as CROWDED_LONG / CROWDED_SHORT. Use when the user asks about COT report analysis, crowded positioning, "who is trapped", speculative positioning extremes, contrarian futures setups, or wants to run Jason Shapiro-style analysis. This skill automates crowding DETECTION only (step 1 of 5) — it does not generate trade signals by itself.

Overview

Publishertradermonty
Repositoryclaude-trading-skills
Skill namecot-contrarian-detector
Stars
2.8K
Forks
647
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by tradermonty on GitHub. Read the source before you install it.

Installation

Install the Cot Contrarian Detector AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tradermonty/claude-trading-skills.git /tmp/claude-trading-skills
mkdir -p .claude/skills
cp -r /tmp/claude-trading-skills/skills/cot-contrarian-detector .claude/skills/cot-contrarian-detector
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cot Contrarian Detector in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cot Contrarian Detector on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cot Contrarian Detector is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

COT Contrarian Detector

Overview

Implements step 1 of Jason Shapiro's COT (Commitment of Traders) contrarian process: detect when large speculators are crowded into one side of a futures market. Crowded positioning is a precondition for a contrarian trade, not a trade signal — a market only becomes tradable once crowding is confirmed by a news failure and price-action reversal (steps 2-3), which this skill guides the user through manually.

Core thesis (Shapiro): Large speculators (hedge funds, CTAs, momentum traders) tend to be maximally positioned at trend exhaustion, not trend inception. When they are already crowded onto one side, the next big move is statistically more likely to run them over than to reward them further. Fade the speculators, not the commercials (commercials hedge for structural reasons and are not a crowd-psychology signal).

When to Use This Skill

English:

  • "What markets are the speculators crowded into right now?"
  • "Run a COT report analysis" / "Show me COT positioning extremes"
  • "Is anyone 'trapped' in gold / the dollar / bonds right now?"
  • User wants to find contrarian futures setups
  • User asks for a Jason Shapiro-style COT screen

Japanese:

  • 「COTレポートで買われすぎ・売られすぎのポジションを調べて」
  • 「投機筋が偏っている市場は?」
  • 「ジェイソン・シャピロ式の逆張り分析をして」

Do NOT use when:

  • The user wants a trade signal right now — crowding alone is not actionable; see Guardrails below
  • The user is asking about individual equities — COT reports cover CFTC futures markets only (indices, rates, FX, metals, energy, agri, crypto), not single stocks

Prerequisites

  • FMP API Key: Required. Set FMP_API_KEY environment variable or pass --api-key. COT endpoints require an FMP Premium+ plan — a free-tier key will not have access.
  • Python 3.9+ with requests installed.
  • API Budget: One call per market (23 for --core, up to ~65 for the full universe), plus one call for the market list when neither --symbols nor --core is given.

Workflow

Phase 1: Run the crowding screen

bash
# Curated core futures universe (23 liquid/representative markets)
python3 skills/cot-contrarian-detector/scripts/screen_cot_crowding.py --core --output-dir reports/

# Explicit symbols
python3 skills/cot-contrarian-detector/scripts/screen_cot_crowding.py --symbols "ES,GC,CL" --output-dir reports/

# Full universe (all ~65 markets FMP's COT list covers)
python3 skills/cot-contrarian-detector/scripts/screen_cot_crowding.py --output-dir reports/

The script fetches each market's weekly legacy COT report (large-speculator long/short positions), computes a 156-week (3-year) and 26-week COT Index per market, and classifies extremes:

  • CROWDED_LONG — COT Index >= 90 (near the 3-year net-long high)
  • CROWDED_SHORT — COT Index <= 10 (near the 3-year net-short high)
  • NEUTRAL — everything in between

Markets with insufficient history to compute the index are never silently dropped — they appear in a skipped list with the reason (e.g. "insufficient history: 40/156 weeks").

Phase 2: Present the crowding report

Present the generated Markdown report, highlighting:

  • Which markets are CROWDED_LONG / CROWDED_SHORT and by how much
  • The 26-week index for context (is the crowding fresh or aging?)
  • Week-over-week net-position swings (fast-moving crowds are more fragile)
  • The methodology note and disclaimer — crowding is not a trade signal

Phase 3: Guide steps 2-5 manually (Shapiro process)

For any CROWDED_LONG / CROWDED_SHORT market the user wants to pursue, load references/shapiro-methodology.md and walk through the remaining steps — these are not automated:

  1. Crowding detection (done — this skill)
  2. News failure — use WebSearch to check whether recent news favorable to the crowd's direction failed to move price the way the crowd would expect (e.g. crowded-long market doesn't rally on bullish news). This is the core edge and the most important manual confirmation.
  3. Price-action confirmation — check the weekly chart for a reversal pattern or a failure at a new high/low.
  4. Entry — against the crowd, with a stop at the recent swing extreme and small, fixed-risk sizing (see position-sizer skill).
  5. Exit — when positioning normalizes toward neutral (COT Index back toward 50) or the stop is hit.

Never recommend an entry from crowding alone — steps 2 and 3 must both confirm first.

Output

  • JSON: reports/cot_crowding_<as-of-date>.json — machine-readable, with a run_context block (schema_version, params, universe, data_date) plus markets (ranked results) and skipped (never silently dropped).
  • Markdown: reports/cot_crowding_<as-of-date>.md — human-readable report with Crowded Long / Crowded Short / Full Ranking / Week-over-Week Swings / Skipped Markets / Methodology sections.

Cadence

CFTC publishes the COT report Fridays ~3:30pm ET, with positions as of the prior Tuesday — data is always 3+ days old by the time it's published, and up to 9 days old by the following Friday. Run this skill:

  • Weekly, after Friday's publication or over the weekend, for a fresh read
  • Ad hoc, when the user asks about a specific market's positioning — the underlying data will be from the most recent Friday release either way

Guardrails

  • Crowdedness alone is NOT a trade signal. It is a precondition. Never suggest an entry without steps 2 (news failure) and 3 (price action) from references/shapiro-methodology.md also confirming.
  • Data is lagged. COT positions are 3-9 days old by the time they're read; do not treat them as a real-time signal.
  • Fade speculators, not commercials. This skill only looks at non-commercial ("large speculator") positioning — commercial hedging flows are structurally different and not a crowd-psychology signal.
  • Not investment advice. All output is for research/educational purposes.

Resources

references/shapiro-methodology.md

The full 5-step process (crowding → news failure → price action → entry → exit), why speculators (not commercials) are the fade target, the 3-day publication lag caveat, and a table of what this skill automates vs. what stays manual. Load this whenever guiding a user past step 1.

references/cot-index-calculation.md

The COT Index formula, lookback rationale (156w primary / 26w context), extreme threshold sensitivity, open-interest normalization rationale, the legacy-vs-disaggregated report distinction (this skill uses the legacy report's non-commercial = large-speculator fields), and a glossary of the FMP COT API field names consumed by scripts/cot_index.py.

When to Load References

  • First use / explaining the methodology: Load references/shapiro-methodology.md
  • Explaining a specific number in the report: Load references/cot-index-calculation.md
  • Regular execution: References not needed — the script handles the crowding computation

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Cot Contrarian Detector AI skill do?

Detect crowded speculative positioning in CFTC futures markets (COT report analysis) to find contrarian setups using Jason Shapiro's methodology. Screens large-speculator ("non-commercial") net positioning across 65 futures markets (indices, rates, FX, metals, energy, crypto) via the FMP Commitment of Traders API, computes a 3-year and 26-week COT Index per market, and classifies extremes as CROWDED_LONG / CROWDED_SHORT. Use when the user asks about COT report analysis, crowded positioning, "who is trapped", speculative positioning extremes, contrarian futures setups, or wants to run Jason...

Why use Cot Contrarian Detector on TypingMind?

Because you install it once and use it with any model. Cot Contrarian Detector is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cot Contrarian Detector in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/tradermonty/claude-trading-skills/tree/main/skills/cot-contrarian-detector. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Cot Contrarian Detector?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cot Contrarian Detector?

As many as you like. As long as a model supports skills, you can use Cot Contrarian Detector with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cot Contrarian Detector AI skill free?

Yes. It is published on GitHub by tradermonty under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇