earnings-trade-analyzer — Claude Code skill: score post-earnings moves
Scores recent post-earnings stocks on five factors, giving each a 0–100 score and an A/B/C/D grade.
npx skills add tradermonty/claude-trading-skills --skill earnings-trade-analyzer -a claude-codeWhat earnings-trade-analyzer does
The skill runs analyze_earnings_trades.py, which pulls the earnings calendar for your window and scores each name on five factors: gap size, the 20-day pre-earnings trend, the 20-day vs 60-day volume ratio, and position against the 200-day and 50-day moving averages. Output is a 0–100 score plus an A/B/C/D grade, written as JSON and a Markdown report under reports/.
You need an FMP API key, set as FMP_API_KEY or passed with --api-key. The free tier covers the default run with a 2-day lookback and top 20; wider windows are where the paid tier comes in. The window is anchored on the America/New_York calendar date rather than your machine's clock, so --as-of gives you a reproducible run.
Failure handling is explicit. A clean empty provider response over a window containing at least one XNYS session is not a quiet day: the script exits 1 with ZERO_RESULT_REASON=earnings_calendar_empty_with_market_sessions. Same for exhausted API budget and an unqueryable calendar. If the script prints Candidates after filtering: 0 and exits successfully, no JSON file is written, so do not try to run PEAD Mode B against a candidate file that does not exist. Worth checking whether the window is genuinely empty or the provider just dropped.
What it helps with
- screen stocks with the strongest recent earnings reactions
- grade each candidate instead of eyeballing gap charts
- find post-earnings momentum candidates for a watchlist
- filter out weak setups with the entry quality flag
- get a JSON and Markdown report for review
Example prompts for the agent
- analyze post-earnings reactions from the last 2 days and show the top 20
- run earnings-trade-analyzer with a 5-day lookback and min market cap 1000000000
- run the analysis with the entry quality filter and walk me through the A and B grades
How to install earnings-trade-analyzer
1Skills CLI (Vercel)
npx skills add tradermonty/claude-trading-skills --skill earnings-trade-analyzer -a claude-code2Manually: put the files in place
~/.claude/skills/earnings-trade-analyzer/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/earnings-trade-analyzer/
1Skills CLI (Vercel)
npx skills add tradermonty/claude-trading-skills --skill earnings-trade-analyzer -a codex2Manually: put the files in place
.agents/skills/earnings-trade-analyzer/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add tradermonty/claude-trading-skills --skill earnings-trade-analyzer -a cursor2Manually: put the files in place
.cursor/skills/earnings-trade-analyzer/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install tradermonty/claude-trading-skills earnings-trade-analyzer2Manually: put the files in place
.github/skills/earnings-trade-analyzer/SKILL.md1Skills CLI (Vercel)
npx skills add tradermonty/claude-trading-skills --skill earnings-trade-analyzer -a gemini-cli2Platform CLI
gemini skills install https://github.com/tradermonty/claude-trading-skills --path skills/earnings-trade-analyzerManually: put the files in place
.devin/skills/earnings-trade-analyzer/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add tradermonty/claude-trading-skills --skill earnings-trade-analyzer -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about earnings-trade-analyzer
How do I install earnings-trade-analyzer in Claude?
Run npx skills add tradermonty/claude-trading-skills --skill earnings-trade-analyzer -a claude-code. The skill lands at ~/.claude/skills/earnings-trade-analyzer/SKILL.md.
What does earnings-trade-analyzer do?
It scores each recent post-earnings stock on five factors, returns a 0–100 score with an A/B/C/D grade, and saves JSON and Markdown reports.
What do I need to run it?
An FMP API key in FMP_API_KEY or passed via --api-key. The default 2-day lookback with top 20 fits the free tier.
Source text
SKILL.md · MIT
--- name: earnings-trade-analyzer description: Analyze recent post-earnings stocks using a 5-factor scoring system (Gap Size, Pre-Earnings Trend, Volume Trend, MA200 Position, MA50 Position). Scores each stock 0-100 and assigns A/B/C/D grades. Use when user asks about earnings trade analysis, post-earnings momentum screening, earnings gap scoring, or finding best recent earnings reactions. --- # Earnings Trade Analyzer - Post-Earnings 5-Factor Scoring Analyze recent post-earnings stocks using a 5-factor weighted scoring system to identify the strongest earnings reactions for potential momentum trades. ## When to Use - User asks for post-earnings trade analysis or earnings gap screening - User wants to find the best recent earnings reactions - User requests earnings momentum scoring or grading - User asks about post-earnings accumulation day (PEAD) candidates ## Prerequisites - FMP API key (set `FMP_API_KEY` environment variable or pass `--api-key`) - Free tier (250 calls/day) is sufficient for default screening (lookback 2 days, top 20) - Paid tier recommended for larger lookback windows or full screening ## Workflow ### Step 1: Run the Earnings Trade Analyzer Execute the analyzer script: ```bash # Default: last 2 days of earnings, top 20 results python3 skills/earnings-trade-analyzer/scripts/analyze_earnings_trades.py --output-dir reports/ # Custom lookback and market cap filter python3 skills/earnings-trade-analyzer/scripts/analyze_earnings_trades.py \ --lookback-days 5 \ --min-market-cap 1000000000 \ --top 30 \ --output-dir reports/ # Deterministic anchor date (America/New_York); the window is anchored on the # ET calendar date, not the runner's local clock. For reproducible runs/tests. python3 skills/earnings-trade-analyzer/scripts/analyze_earnings_trades.py \ --as-of 2026-09-15 \ --output-dir reports/ # With entry quality filter python3 skills/earnings-trade-analyzer/scripts/analyze_earnings_trades.py \ --apply-entry-filter \ --output-dir reports/ ``` #### Degraded endpoint / budget fallback for scheduled reviews If the analyzer reports a 404, an implausible empty earnings calendar, or exhausts its API-call budget before producing scored candidates during a scheduled after-close/pre-market run, do not report "no earnings reactions" immediately. A clean empty response over a date window containing at least one XNYS session exits 1 with `ZERO_RESULT_REASON=earnings_calendar_empty_with_market_sessions`. If the shared XNYS calendar cannot classify the window, it exits 1 with `ZERO_RESULT_REASON=market_calendar_unavailable`. Budget or daily rate-limit exhaustion during profile fetching exits 1 with `ZERO_RESULT_REASON=profiles_budget_exhausted`. Treat each as a failed run to retry or fall back on, not a quiet day. Only a clean empty response over a zero-session window exits 0 as `ZERO_RESULT_REASON=no_earnings_rows`. 1. First retry once with a narrower liquid-universe configuration so the full 5-factor scorer has a chance to complete, for example: ```bash python3 skills/earnings-trade-analyzer/scripts/analyze_earnings_trades.py \ --lookback-days 2 \ --min-market-cap 5000000000 \ --top 20 \ --max-api-calls 600 \ --output-dir reports/<routine-date> ``` 2. If the scored run still returns no candidates or cannot complete, verify the same range through the stable endpoint used by the compatibility shim and clearly label the result as an ungraded fallback: ```bash curl "https://financialmodelingprep.com/stable/earnings-calendar?from=YYYY-MM-DD&to=YYYY-MM-DD&apikey=$FMP_API_KEY" ``` Then optionally enrich returned US tickers through the analyzer's stable-first FMP client or per-symbol `/stable/quote?symbol=<ticker>` calls to rank by same-day `changesPercentage`, market cap, and liquidity. Use legacy `/api/v3` quote calls only as a legacy-key fallback after stable has failed. Present these as **preliminary / ungraded reactions** because the 5-factor scorer did not run; do not assign A/B/C/D grades from the fallback alone. **No-candidate output pitfall:** The analyzer may print `Candidates after filtering: 0` / `No candidates found matching criteria.` and exit successfully without writing an `earnings_trade_analyzer_*.json` file. In that case, do not try to run PEAD Mode B from a nonexistent candidate file. Say explicitly that no scored analyzer JSON was produced, run the endpoint/quote enrichment fallback above if the routine needs an earnings section, and label any names as manual-review only. This success-exit path does not cover budget exhaustion during profile fetching: that case exits 1 (`ZERO_RESULT_REASON=profiles_budget_exhausted`) instead. #### Empty windows and today-only runs The earnings calendar window is inclusive and uses the `America/New_York` calendar date from `--as-of` (or the current ET date). A clean provider `[]` is a benign quiet-window result only when the shared XNYS calendar successfully counts zero exchange sessions in that exact window, such as a weekend or holiday. If the window contains an XNYS session, the same clean `[]` exits 1 with `ZERO_RESULT_REASON=earnings_calendar_empty_with_market_sessions` so a provider drop is not reported as a quiet day. If the XNYS calendar cannot be queried, the run also exits 1 with `ZERO_RESULT_REASON=market_calendar_unavailable`. `--lookback-days 0` is valid and queries exactly the single ET as-of date. Use it after the relevant announcements have been published (normally after the session close); an empty response on an XNYS session remains intentionally fail-closed. A non-empty response whose rows do not carry a `symbol` retains the separate `ZERO_RESULT_REASON=no_earnings_rows` behavior; that case is not the literal-empty-list session check above. ### Step 2: Review Results 1. Read the generated JSON and Markdown reports 2. Load `references/scoring_methodology.md` for scoring interpretation context 3. Focus on Grade A and B stocks for actionable setups ### Step 3: Present Analysis For each top candidate, present: - Composite score and letter grade (A/B/C/D) - Earnings gap size and direction - Pre-earnings 20-day trend - Volume ratio (20-day vs 60-day average) - Position relative to 200-day and 50-day moving averages - Weakest and strongest scoring components ### Step 4: Provide Actionable Guidance Based on grades: - **Grade A (85+):** Strong earnings reaction with institutional accumulation - consider entry - **Grade B (70-84):** Good earnings reaction worth monitoring - wait for pullback or confirmation - **Grade C (55-69):** Mixed signals - use caution, additional analysis needed - **Grade D (<55):** Weak setup - avoid or wait for better conditions ## Output - `earnings_trade_analyzer_YYYY-MM-DD_HHMMSS.json` - Structured results with schema_version "1.0" - `earnings_trade_analyzer_YYYY-MM-DD_HHMMSS.md` - Human-readable report with tables ### Unknown earnings timing FMP does not confirm a bmo/amc session for every earnings row; unconfirmed rows report `earnings_timing: "unknown"` and the gap calculation assumes the AMC window as a fallback. Both reports surface `timing_unknown_count` out of `timing_candidates_total` so this assumption stays visible rather than blending unnoticed into the scores. ## Resources - `references/scoring_methodology.md` - 5-factor scoring system, grade thresholds, and entry quality filter rules
© tradermonty · MIT · tradermonty/claude-trading-skills