GuideOpen

Signal Postmortem (en)

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. {: .fs-6 .fw-300 }

Front matter
layout: default
title: "Signal Postmortem"
grand_parent: English
parent: Skill Guides
nav_order: 11
lang_peer: /ja/skills/signal-postmortem/
permalink: /en/skills/signal-postmortem/

Signal Postmortem

{: .no_toc }

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. {: .fs-6 .fw-300 }

<span class="badge badge-optional">FMP Optional</span>

View Source on GitHub{: .btn .fs-5 .mb-4 .mb-md-0 }

<details open markdown="block"> <summary>Table of Contents</summary> {: .text-delta }

  • TOC

{:toc} </details>


1. 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.


2. 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

3. 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)

4. Quick Start

# 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

5. 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:

CategoryDefinition
TRUE_POSITIVEPredicted direction matched realized return sign
FALSE_POSITIVEPredicted direction opposite to realized return
MISSED_OPPORTUNITYSignal not taken but would have been profitable
REGIME_MISMATCHSignal failed due to market regime change

Classification rules are documented in references/outcome-classification.md.

Step 4: Generate Feedback Files

Generate feedback for downstream consumers:

# Generate weight adjustment suggestions for edge-signal-aggregator
python3 skills/signal-postmortem/scripts/postmortem_analyzer.py \
  --postmortems-dir reports/postmortems/ \
  --generate-weight-feedback \
  --output-dir reports/

# Generate skill improvement backlog entries
python3 skills/signal-postmortem/scripts/postmortem_analyzer.py \
  --postmortems-dir reports/postmortems/ \
  --generate-improvement-backlog \
  --output-dir reports/

Step 5: Review Summary Statistics

Generate aggregate statistics by skill, by ticker, and by time period:

python3 skills/signal-postmortem/scripts/postmortem_analyzer.py \
  --postmortems-dir reports/postmortems/ \
  --summary \
  --group-by skill,month \
  --output-dir reports/

6. Resources

References:

  • skills/signal-postmortem/references/feedback-integration.md
  • skills/signal-postmortem/references/outcome-classification.md

Scripts:

  • skills/signal-postmortem/scripts/postmortem_analyzer.py
  • skills/signal-postmortem/scripts/postmortem_recorder.py

Source: https://github.com/tradermonty/claude-trading-skills/blob/main/docs/en/skills/signal-postmortem.md

Author: tradermonty, Trading skills. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The Claude Code library holds 13,843 entries. Members can search all of them by meaning and read every one in full.