Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

signal-postmortem

БесплатноЗапускает вложенные скриптыНе проверен

Record and analyze post-trade outcomes for signals generated by edge pipeline and other skills. Track false positives, missed opportunities, and regime…

tradermontyот tradermonty★ 9 343 звезды на GitHub

Об этом скилле

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 ou

Полный SKILL.md на GitHub

Установить signal-postmortem в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/feedback-integration.mdreferences/outcome-classification.mdrequirements.txtscripts/fmp_client.pyscripts/postmortem_analyzer.pyscripts/postmortem_fmp_client.pyscripts/postmortem_recorder.py

FAQ

Что делает скилл 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.

Как установить скилл signal-postmortem?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл signal-postmortem запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить signal-postmortem с