backtest-expert
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
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.
Claude Code
$ npx -y skills add tradermonty/claude-trading-skills --skill signal-postmortem --agent claude-code
Codex
$ npx skills add tradermonty/claude-trading-skills --skill signal-postmortem -a codex -y
Cursor
$ npx skills add tradermonty/claude-trading-skills --skill signal-postmortem -a cursor -y
Gemini CLI
$ npx skills add tradermonty/claude-trading-skills --skill signal-postmortem -a gemini-cli -y
GitHub Copilot
$ npx skills add tradermonty/claude-trading-skills --skill signal-postmortem -a github-copilot -y
OpenCode
$ npx skills add tradermonty/claude-trading-skills --skill signal-postmortem -a opencode -y
Windsurf
$ npx skills add tradermonty/claude-trading-skills --skill signal-postmortem -a windsurf -y
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 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.
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.
Gather closed or matured signal records. Each record should include:
# 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
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.
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
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.
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating…
This skill should be used when analyzing market breadth charts, specifically the S&P 500 Breadth Index (200-Day MA based) and the…
Generate Minervini-style breakout trade plans from VCP screener output with worst-case risk calculation, portfolio heat…
Screen US stocks using William O'Neil's CANSLIM growth stock methodology. Use when user requests CANSLIM stock screening, growth…
Synthesize the three Jason Shapiro contrarian-pipeline verdicts (COT crowding, news-reaction failure, weekly price-action…
Detect crowded speculative positioning in CFTC futures markets (COT report analysis) to find contrarian setups using Jason…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…
Complete, populate and fill out 3-statement financial model templates (Income Statement, Balance Sheet, Cash Flow Statement) .…