Skip to content
Finance
Skill

/signal-postmortem

Record and analyze post-trade outcomes for signals generated by edge pipeline and other skills. Track false positives, missed opportunities, and regime mismatches. Feed results back to edge-signal-aggregator weights and skill improvement backlog.

From plugin
claude-trading-skills
6.9k74 skills2 agents2 commands

Claude Code

$ npx -y skills add tradermonty/claude-trading-skills --skill signal-postmortem --agent claude-code

SKILL.md

signal-postmortem.SKILL.md
name: signal-postmortem
description: Record and analyze post-trade outcomes for signals generated by edge pipeline and other skills. Track false positives, missed opportunities, and regime mismatches. Feed results back to edge-signal-aggregator weights and skill improvement backlog.

Signal Postmortem

Overview

Signal Postmortem records and analyzes the outcomes of trading signals generated by the edge pipeline, screeners, and other skills. It compares predicted edge direction against 5-day and 20-day realized returns, categorizes outcomes (true positive, false positive, missed opportunity, regime mismatch), and generates feedback for edge-signal-aggregator weight adjustments and skill improvement backlog entries.

When to Use

  • After a trade has been closed and you want to record the outcome
  • When reviewing a batch of signals that have reached their holding period (5 or 20 days)
  • To identify systematic false positive patterns from specific skills
  • To generate feedback for edge-signal-aggregator weight calibration
  • When building a skill improvement backlog from decision quality metrics
  • For periodic (weekly/monthly) signal quality audits

Prerequisites

  • Python 3.9+
  • FMP API key (optional, for fetching realized returns if not provided manually)
  • Standard library + `requests` for API calls
  • Input: signal records in JSON format (from edge-signal-aggregator or screener outputs)

API Key Setup (Optional)

If you want to automatically fetch price data for return calculations, set up the FMP API key:

export FMP_API_KEY=your_api_key_here

Alternatively, pass the key via command line with `--api-key YOUR_KEY`. Without an API key, record manual outcomes from a saved signal with `--signals-file`, `--signal-id`, `--exit-price` and `--exit-date`. The saved signal must include a finite positive entry price.

Workflow

Step 1: Prepare Signal Records

Gather closed or matured signal records. Each record should include:

  • `signal_id`: Unique identifier
  • `ticker`: Stock symbol
  • `signal_date`: Date signal was generated
  • `predicted_direction`: LONG or SHORT
  • `source_skill`: Which skill generated the signal
  • `entry_price`: Price at signal generation (required for manual recording; batch may fetch it)
# Example: List signals ready for postmortem (5+ days old)
python3 skills/signal-postmortem/scripts/postmortem_recorder.py \
  --list-ready \
  --signals-dir state/signals/ \
  --min-days 5

Step 2: Record Outcomes

Run the postmortem recorder to fetch realized returns and classify outcomes.

python3 skills/signal-postmortem/scripts/postmortem_recorder.py \
  --signals-file state/signals/aggregated_signals_2026-03-10.json \
  --holding-periods 5,20 \
  --output-dir reports/

Automatic lookup uses FMP’s stable historical endpoint for the exact requested date range. Access failures are unavailable evidence; no legacy endpoint is tried. Manual recording remains offline, and `requests` is required only for automatic lookup.

Batch recording requires observed finite positive entry and 5-day exit prices. The exit uses the first usable price from day 5 through day 9 (calendar days), with the observed date recorded. Without a key or usable prices, signals are skipped instead of being classified as NEUTRAL. A real observed flat return is still NEUTRAL. Missing/non-finite secondary returns (such as 20d) are omitted; missing/non-finite 5d returns skip the signal. Include `5` in `--holding-periods` for batch classification; reordering periods does not change the primary exit.

The batch summary reports `processed` and `skipped`. A batch with zero processed signals exits 1 and writes only a diagnostic batch summary; mixed batches save valid records and exit 0. Check skipped counts before using the results. Skipped signals do not overwrite existing records. Previously saved records are not repaired or excluded automatically; review older records before analyzing them.

For manual outcome recording (when price data is already available):

python3 skills/signal-postmortem/scripts/postmortem_recorder.py \
  --signals-file state/signals/aggregated_signals_2026-03-10.json \
  --signal-id sig_aapl_20260310_abc \
  --exit-price 178.50 \
  --exit-date 2026-03-15 \
  --outcome-notes "Closed at target, +3.2% in 5 days" \
  --output-dir reports/

Manual mode requires exactly one matching saved signal; it never infers metadata from the ID or fetches prices. Entry and exit must be finite positive prices, dates must be canonical `YYYY-MM-DD`, and exit cannot precede signal date. Missing/ambiguous source evidence or an unrepresentable return fails without writing or replacing an outcome. Source and output must be different files, including symlink/hardlink aliases. Supply the source file when using the manual example; an ID and exit alone are insufficient.

Manual classification uses `(exit - entry) / entry`, the saved LONG/SHORT direction and existing thresholds. The record carries `return_basis: actual_exit` and `realized_returns.actual`; `holding_days` is elapsed calendar days. This is raw price change, not position-sized, leveraged or fee-adjusted P&L. Actual exit returns do not populate the 5d/20d benchmark fields. The analyzer counts their outcomes and months but averages only observed finite 5d values, with `return_samples_5d` coverage and null/N/A when none exist. Existing fabricated records are not automatically repaired; review historical data separately.

Step 3: Classify Outcomes

The recorder automatically classifies each signal into one of four categories:

| Category | Definition | |----------|------------| | TRUE_POSITIVE | Predicted direction matched realized return sign | | FALSE_POSITIVE | Predicted direction opposite to realized return | | MISSED_OPPORTUNITY | Signal not taken but would have been profitable | | REGIME_MISMATCH | Signal failed due to market regime change |

Classification rules are documented in `refer

Read more
@tradermonty
Ships withclaude-trading-skills

Data handling: Privacy policy · Security policy Claude Trading Skills started as a personal project to use AI to improve my own trading process. Claude Trading Skills is a Claude Skills-based trading workflow toolkit for time-constrained individual investors.

6.9k74 skills2 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
6.9k
Star history of tradermonty/claude-trading-skills on GitHub, a chart by star-history.com

Other skills on claude-trading-skills.

More skills from other plugins.

ccxt-cli

ccxt-cli

CCXT command-line interface (ccxt-cli) for interacting with 100+ cryptocurrency exchanges directly from the terminal — no code…

ccxt10d45k
@ccxt@ccxtInstall Skill

Questions about signal-postmortem.

Which coding agents can use signal-postmortem?
signal-postmortem installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.