跳到正文
cccskills
免费在 GitHub 公开

signal-postmortem

Compare trading signals with actual returns after 5 and 20 days, then record successes, false positives, missed opportunities, and market-condition mismatches. Generate summaries by source skill, suggested signal weights, and a backlog of improvements.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

实测评分 未实测

查看安装方法

适用场景

  • Recording outcomes after closing trades
  • Reviewing batches of signals after their holding periods
  • Finding recurring false positives by source skill
  • Preparing weight adjustments and a skill improvement backlog

包含的文件(10)

  • SKILL.md6.6 KB
  • references/feedback-integration.md5.1 KB
  • references/outcome-classification.md5.0 KB
  • requirements.txt128 B
  • scripts/postmortem_analyzer.py18.7 KB
  • scripts/postmortem_recorder.py14.5 KB
  • scripts/tests/conftest.py230 B
  • scripts/tests/test_cli_workflow.py11.8 KB
  • scripts/tests/test_postmortem_analyzer.py11.0 KB
  • scripts/tests/test_postmortem_recorder.py7.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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, you can still record outcomes manually by providing --exit-price and --exit-date.

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 (optional, for manual override)
# 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/

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

python3 skills/signal-postmortem/scripts/postmortem_recorder.py \
  --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/

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/

Output Format

Postmortem Record (JSON)

{
  "schema_version": "1.0",
  "postmortem_id": "pm_sig_aapl_20260310_abc",
  "signal_id": "sig_aapl_20260310_abc",
  "ticker": "AAPL",
  "signal_date": "2026-03-10",
  "source_skill": "edge-signal-aggregator",
  "predicted_direction": "LONG",
  "entry_price": 172.50,
  "realized_returns": {
    "5d": 0.032,
    "20d": 0.058
  },
  "exit_price": 178.50,
  "exit_date": "2026-03-15",
  "holding_days": 5,
  "outcome_category": "TRUE_POSITIVE",
  "regime_at_signal": "RISK_ON",
  "regime_at_exit": "RISK_ON",
  "outcome_notes": "Clean breakout, held through minor pullback",
  "recorded_at": "2026-03-17T10:30:00Z"
}

Weight Feedback (JSON)

{
  "schema_version": "1.0",
  "generated_at": "2026-03-17T10:35:00Z",
  "analysis_period": {
    "from": "2026-02-01",
    "to": "2026-03-15"
  },
  "skill_adjustments": [
    {
      "skill": "vcp-screener",
      "current_weight": 1.0,
      "suggested_weight": 0.85,
      "reason": "15% false positive rate in RISK_OFF regime",
      "sample_size": 42
    }
  ],
  "confidence": "MEDIUM",
  "min_sample_threshold": 20
}

Skill Improvement Backlog Entry (YAML)

- skill: vcp-screener
  issue_type: false_positive_cluster
  severity: medium
  evidence:
    false_positive_rate: 0.15
    sample_size: 42
    regime_correlation: RISK_OFF
  suggested_action: "Add regime filter or reduce signal confidence in RISK_OFF"
  generated_by: signal-postmortem
  generated_at: "2026-03-17T10:35:00Z"

Summary Report (Markdown)

Reports are saved to reports/ with filenames postmortem_summary_YYYY-MM-DD.md.

Resources

  • scripts/postmortem_recorder.py -- Records individual signal outcomes
  • scripts/postmortem_analyzer.py -- Generates feedback and summary statistics
  • references/outcome-classification.md -- Classification rules and edge cases
  • references/feedback-integration.md -- How to integrate feedback with downstream skills

Key Principles

  1. Honest Attribution -- Every outcome is attributed to its source skill for accountability
  2. Regime Awareness -- Regime context is recorded to distinguish skill failure from market regime shifts
  3. Minimum Sample Size -- Weight adjustments require 20+ signals for statistical validity
  4. Feedback Loop Closure -- Results flow back to improve both signal aggregation and skill quality

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Plan and assess backtests, which test trading rules against historical data. Examine sensitivity to rule changes, trading costs, and data bias, then use supplied performance metrics to generate a structured evaluation with reasons that block adoption.

中文简介正在准备中。当前显示英语简介。

  • Define a backtesting plan for rule-based trading
  • Test sensitivity to parameters and trading costs
  • Investigate suspiciously strong backtest results
tradermonty/claude-trading-skills32222026年10月21日 更新

Assess how broadly US stock market gains are shared across stocks using public CSV data and optional charts. Produce English reports covering market conditions, trading signals, scenarios, and positioning for different investment timeframes.

中文简介正在准备中。当前显示英语简介。

  • Checking how broadly US stocks are participating in a market rise
  • Reviewing medium- to long-term market positioning
  • Assessing short-term swing trading signals
tradermonty/claude-trading-skills32222026年10月21日 更新

Analyze chart images showing how broadly US stocks are participating in market trends. Assess medium-term conditions and short-term signals, then produce an English report with positioning guidance, alternative scenarios, and risks based on the visible data.

中文简介正在准备中。当前显示英语简介。

  • Assessing the market cycle from an S&P 500 breadth chart
  • Checking short-term signals in an uptrend stock ratio chart
  • Comparing medium-term and short-term market signals
tradermonty/claude-trading-skills32222026年10月21日 更新

Turn VCP screening results, which identify narrowing price swings, into breakout trade plans. Calculate entry, stop-loss, target prices, and position sizes using worst-case entries, while applying portfolio risk limits and producing Alpaca-compatible order templates.

中文简介正在准备中。当前显示英语简介。

  • Planning entries, stop-losses, and profit targets for VCP candidates
  • Calculating position sizes from account size and risk limits
  • Checking total portfolio risk and sector exposure
tradermonty/claude-trading-skills32222026年10月21日 更新

Screen US growth stocks with William O'Neil's CANSLIM method, which evaluates seven factors including earnings, price strength, trading volume, and market direction. Receive ranked candidates with composite scores, factor breakdowns, market warnings, and data quality notes.

中文简介正在准备中。当前显示英语简介。

  • Find US stocks with earnings growth and price momentum
  • Compare a chosen list of stocks using CANSLIM scores
  • Screen a sector-focused stock list
tradermonty/claude-trading-skills32222026年10月21日 更新

Combine three reports on crowded positions, failed reactions to news, and weekly price reversals into one trading setup status. Identify missing or invalid evidence and determine whether the setup is ready for planning.

中文简介正在准备中。当前显示英语简介。

  • Combine three contrarian strategy reports
  • Check which confirmations are still missing
  • Find stale or inconsistent input reports
tradermonty/claude-trading-skills32222026年10月21日 更新

查看 tradermonty 的全部技能

报告此技能的问题