Coil Scan logo

Coil Scan

Community
mphinance
coil-scan

Daily scanner that finds stocks sitting in the "bottom of the coil" using a dual-timeframe Williams %R Trend Exhaustion indicator, then flags the ones that just triggered out. Silent data feed for Michael — he writes trade posts only when he likes a name. Use when the user asks about "coil scan", "bottom of the coil", "what's coiled", "daily coil", "%R exhaustion scan", "what's oversold and turning", or wants to find deeply oversold names that are just starting to reverse.

Overview

Publishermphinance
Repositoryalpha-skills
Skill namecoil-scan
Stars
32
Forks
6
Bundled files
2
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.

  • 2 bundled files

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

  • Open source

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

Installation

Install the Coil Scan 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.
    https://github.com/mphinance/alpha-skills/tree/main/plugins/quant-skills/skills/coil-scan
  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/mphinance/alpha-skills.git /tmp/alpha-skills
mkdir -p .claude/skills
cp -r /tmp/alpha-skills/plugins/quant-skills/skills/coil-scan .claude/skills/coil-scan
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Coil Scan 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 Coil Scan 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 Coil Scan 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.

Coil Scan — dual-timeframe %R Trend Exhaustion

Mirrors the "%R Trend Exhaustion [upslidedown]" TradingView indicator (dual timeframe 21 + 112). Finds stocks that are both deeply oversold AND just starting to reverse.

The indicator math

  • %R(n) = Williams %R = 100 * (close - highestHigh_n) / (highestHigh_n - lowestLow_n), range −100…0.
  • Fast leg = EMA(7) of %R(21).
  • Slow leg = EMA(3) of %R(112).
  • Threshold (TH) = −80.
  • In the coil: both fast AND slow ≤ −80. The short-term AND the structural picture are both deeply oversold. This is the stalk zone — a name can sit here for days/weeks before the trigger fires.
  • Triggered out: fast crossed back above −80 while it was recently (within ~20 bars) coiled on both legs. The slow leg still lagging confirms the structural exhaustion hasn't reset — this is the bullish reversal signal.

Two output buckets

⚡ TRIGGERED OUT (≤3 days ago)

Fast just crossed back above −80. These are actionable reversal candidates.

A sanity check filters false-positives:

  • If the close is already >5% above the price on the trigger date → tagged "already ran — not fresh" and downranked.
  • If the close is now above EMA21 → same tag.

The canonical false-positive this catches: SLB crossed up but had already run +4% to just under its 21EMA by the time the scan ran — that's a chase, not an entry. It lands in the sanity-filtered section, not the fresh list.

🟢 IN THE COIL (stalk candidates)

Both legs ≤ −80, no trigger yet. Sorted deepest-first (most negative slow leg = most structurally exhausted).

The days-in-coil counter comes from the persistent state file (state/coil_watch.json), so the scan can say "IREN — day 6 in the coil." A name stays in the store until it triggers or exits the coil entirely.

Per-name display

SYM    fast%R   slow%R   depth    close   day-in-coil   vs SMA200  vs EMA21
IREN    -92.3    -88.1   -8.1    $7.42   day 3          below SMA200  below EMA21
  • depth: min(fast, slow) − (−80). Negative = deeper in the hole.
  • above/below SMA200 + EMA21: from live technicals endpoint.

How to run

From the repo root or anywhere under it:

bash
python .claude/skills/coil-scan/scripts/coil_scan.py

Options:

bash
# smoke test against a short list
python coil_scan.py --universe IREN,RGTI,SMCI,SLB,FIG,GLD,ASTS

# limit universe size
python coil_scan.py --limit 50

# write JSON output
python coil_scan.py --json /tmp/coil_2026-07-19.json

# custom universe file (one ticker per line, or comma-separated)
python coil_scan.py --universe /tmp/my_watchlist.txt

Universe defaults to: all live TDPro screeners + stock-recap persistent watch list (falls back to the most recent stock-recap/runs/*/raw/screener_*.json if the live API is unavailable). Aim: ~150–200 names.

Persistence

state/coil_watch.json is keyed by ticker and tracks:

  • firstSeen — date first seen in the coil
  • daysInCoil — rolling counter updated each run
  • entryClose / lastClose — price anchors
  • triggered / triggerDate — when the cross fired

On each run: newly-coiled names are added, existing names increment their counter, triggered names are flagged, and names that left the coil without triggering are dropped.

Data sources

  • Bars: GET /api/agent/ticker/{SYMBOL}/chart-data?days=365 (TraderDaddy Pro Railway API; Bearer token from .env_agent_api). Needs ≥115 bars for the slow %R(112) leg.
  • Live technicals: GET /api/agent/ticker/{SYMBOL} (close, ema21, sma200, atr, rsi — used for sanity check + display).
  • Universe: GET /api/screeners + GET /api/screeners/{id}/run × 10.

Interpreting results for Michael

  • Empty IN THE COIL list: tape is not oversold broadly — that's fine, nothing to stalk beats a list of knives.
  • Triggered + already ran: it moved without you. Note it for the next pullback but don't chase.
  • Triggered fresh + below EMA21: highest-quality entry zone. Fast is turning, structure is still washed out, price hasn't reclaimed the mean yet.
  • In coil day 10+: structural exhaustion is deep. The longer it coils, the more compressed the spring. Watch for the fast leg to tick back above −80.

The scan is a data layer — Michael confirms setups on Ghost Flow (the %R EXHAUST panel is visible there) before sizing.

Trigger A/B harness (coil_ab.py)

A sibling script runs two trigger rules side by side so we can settle whether tightening the trigger helps:

  • CURRENT (find_trigger): both legs were ≤ −80, then fast crosses > −80. Slow is not required to still be under −80 at the cross.
  • STRICT: fast crosses > −80 while slow is still ≤ −80 at that same bar ("fast breaks while slow still under"). A subset of CURRENT.

A 2026-07-21 backtest found STRICT is worse — the crosses it drops (slow already recovered = both legs lifting together = structural confirmation) outperformed at every horizon (3/5/10/20d). Fast-leads-while-slow-buried is the earlier but weaker (knife) signal. So the harness is a live forward test to confirm that before deciding.

bash
python coil_ab.py            # log today's fresh triggers under both rules
python coil_ab.py --report   # re-price the ledger, print STRICT vs CURRENT-ONLY

Ledger: state/ab_ledger.json (deduped per symbol|trig_date). Logs daily via weekday 22:00-UTC cron → state/ab_cron.log. Core coil_scan.py is untouched.

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 Coil Scan AI skill do?

Daily scanner that finds stocks sitting in the "bottom of the coil" using a dual-timeframe Williams %R Trend Exhaustion indicator, then flags the ones that just triggered out. Silent data feed for Michael — he writes trade posts only when he likes a name. Use when the user asks about "coil scan", "bottom of the coil", "what's coiled", "daily coil", "%R exhaustion scan", "what's oversold and turning", or wants to find deeply oversold names that are just starting to reverse.

Why use Coil Scan on TypingMind?

Because you install it once and use it with any model. Coil Scan 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 Coil Scan in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mphinance/alpha-skills/tree/main/plugins/quant-skills/skills/coil-scan. 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 Coil Scan?

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 Coil Scan?

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

Is the Coil Scan AI skill free?

Yes. It is published on GitHub by mphinance 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 👇