Community코딩 & 개발github.com

tradermonty/signal-postmortem

거래 후 신호 결과를 기록하고 분석합니다. 엣지 파이프라인 및 기타 스킬에서 생성된 신호의 허위 양성, 놓친 기회, 체제 불일치를 추적하고, 결과를 엣지 신호 수집기 가중치 및 스킬 개선 백로그에 피드백합니다.

signal-postmortem란 무엇인가요?

Signal Postmortem은 엣지 파이프라인, 스크리너 및 기타 스킬에서 생성된 트레이딩 신호의 결과를 체계적으로 기록하고 분석하는 AI 에이전트 스킬입니다. 각 신호의 예측 방향을 5일 및 20일 실현 수익률과 비교하여 진짜 양성, 허위 양성, 놓친 기회, 체제 불일치의 네 가지 범주로 분류합니다. 결과는 edge-signal-aggregator의 가중치 조정 피드백과 스킬 개선 백로그 항목으로 변환되어, 지속적인 학습과 시스템 최적화를 지원합니다. CLI 기반 워크플로우를 통해 Python 3.9+ 환경에서 실행되며, FMP API 키로 가격 데이터를 자동으로 가져오거나 수동으로 데이터를 제공할 수 있습니다. Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 사용할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/tradermonty/claude-trading-skills/tree/main/skills/signal-postmortem

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

신호 사후 분석 (Signal Postmortem)

개요

Signal Postmortem은 엣지 파이프라인, 스크리너 및 기타 스킬에서 생성된 트레이딩 신호의 결과를 기록하고 분석합니다. 예측된 방향을 5일 및 20일 실현 수익률과 비교하고, 결과를 진짜 양성(true positive), 허위 양성(false positive), 놓친 기회(missed opportunity), 체제 불일치(regime mismatch)로 분류합니다. 또한 edge-signal-aggregator 가중치 조정을 위한 피드백과 스킬 개선 백로그 항목을 생성합니다.

사용 시기

  • 거래가 종료되고 그 결과를 기록하려는 경우
  • 보유 기간(5일 또는 20일)에 도달한 신호 배치를 검토할 때
  • 특정 스킬에서 체계적인 허위 양성 패턴을 식별하려는 경우
  • edge-signal-aggregator 가중치 보정을 위한 피드백을 생성할 때
  • 의사 결정 품질 지표에서 스킬 개선 백로그를 구축할 때
  • 정기적인(주간/월간) 신호 품질 감사를 수행할 때

사전 요구 사항

  • Python 3.9+
  • FMP API 키 (선택 사항, 수동으로 제공하지 않는 경우 실현 수익률 가져오기용)
  • 표준 라이브러리 + API 호출용 requests
  • 입력: JSON 형식의 신호 기록 (edge-signal-aggregator 또는 스크리너 출력)

API 키 설정 (선택 사항)

수익률 계산을 위해 가격 데이터를 자동으로 가져오려면 FMP API 키를 설정하세요.

export FMP_API_KEY=your_api_key_here

또는 명령줄에서 --api-key YOUR_KEY로 키를 전달할 수 있습니다. API 키가 없으면 --exit-price와 --exit-date를 제공하여 수동으로 결과를 기록할 수 있습니다.

워크플로우

1단계: 신호 기록 준비

종료되었거나 성숙한 신호 기록을 수집합니다. 각 기록에는 다음이 포함되어야 합니다.

  • signal_id: 고유 식별자
  • ticker: 주식 심볼
  • signal_date: 신호가 생성된 날짜
  • predicted_direction: LONG 또는 SHORT
  • source_skill: 신호를 생성한 스킬
  • entry_price: 신호 생성 시 가격 (선택 사항, 수동 재정의용)
# 예: 사후 분석 준비가 완료된 신호 목록 (5일 이상 경과)
python3 skills/signal-postmortem/scripts/postmortem_recorder.py \
  --list-ready \
  --signals-dir state/signals/ \
  --min-days 5

2단계: 결과 기록

사후 분석 기록기를 실행하여 실현 수익률을 가져오고 결과를 분류합니다.

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/

수동 결과 기록 (가격 데이터가 이미 있는 경우):

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 "목표가에서 청산, 5일 동안 +3.2%" \
  --output-dir reports/

3단계: 결과 분류

기록기는 자동으로 각 신호를 네 가지 범주 중 하나로 분류합니다.

범주정의
TRUE_POSITIVE예측 방향이 실현 수익률 부호와 일치함
FALSE_POSITIVE예측 방향이 실현 수익률과 반대임
MISSED_OPPORTUNITY신호가 실행되지 않았으나 수익성이 있었을 경우
REGIME_MISMATCH시장 체제 변화로 인해 신호가 실패함

분류 규칙은 references/outcome-classification.md에 문서화되어 있습니다.

4단계: 피드백 파일 생성

다운스트림 소비자를 위한 피드백을 생성합니다.

# edge-signal-aggregator를 위한 가중치 조정 제안 생성
python3 skills/signal-postmortem/scripts/postmortem_analyzer.py \
  --postmortems-dir reports/postmortems/ \
  --generate-weight-feedback \
  --output-dir reports/

# 스킬 개선 백로그 항목 생성
python3 skills/signal-postmortem/scripts/postmortem_analyzer.py \
  --postmortems-dir reports/postmortems/ \
  --generate-improvement-backlog \
  --output-dir reports/

5단계: 요약 통계 검토

스킬별, 티커별, 기간별 집계 통계를 생성합니다.

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

출력 형식

사후 분석 기록 (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": "깔끔한 돌파, 약간의 조정을 견딤",
  "recorded_at": "2026-03-17T10:30:00Z"
}

가중치 피드백 (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": "RISK_OFF 체제에서 15% 허위 양성률",
      "sample_size": 42
    }
  ],
  "confidence": "MEDIUM",
  "min_sample_threshold": 20
}

스킬 개선 백로그 항목 (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: "RISK_OFF 체제에서 체제 필터 추가 또는 신호 신뢰도 감소"
  generated_by: signal-postmortem
  generated_at: "2026-03-17T10:35:00Z"

요약 보고서 (Markdown)

보고서는 reports/ 디렉토리에 postmortem_summary_YYYY-MM-DD.md 파일명으로 저장됩니다.

리소스

  • scripts/postmortem_recorder.py -- 개별 신호 결과 기록
  • scripts/postmortem_analyzer.py -- 피드백 및 요약 통계 생성
  • references/outcome-classification.md -- 분류 규칙 및 경계 사례
  • references/feedback-integration.md -- 다운스트림 스킬과 피드백 통합 방법

주요 원칙

  1. 정직한 귀속 -- 모든 결과는 책임 추적을 위해 해당 소스 스킬에 귀속됩니다.
  2. 체제 인식 -- 체제 컨텍스트를 기록하여 스킬 실패와 시장 체제 변화를 구분합니다.
  3. 최소 표본 크기 -- 가중치 조정에는 통계적 유의성을 위해 20개 이상의 신호가 필요합니다.
  4. 피드백 루프 종료 -- 결과는 신호 수집 및 스킬 품질을 모두 개선하기 위해 피드백됩니다.

Individual skills in this repo

This repo contains 14 individual skills — each has its own dedicated page.

tradermonty/backtest-expert

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

tradermonty/market-environment-analysis

Comprehensive market environment analysis and reporting tool. Analyzes global markets including US, European, Asian markets, forex, commodities, and economic indicators. Provides risk-on/risk-off assessment, sector analysis, and technical indicator interpretation. Triggers on keywords like market analysis, market environment, global markets, trading environment, market conditions, investment climate, market sentiment, forex analysis, stock market analysis, 相場環境, 市場分析, マーケット状況, 投資環境.

tradermonty/market-news-analyst

This skill should be used when analyzing recent market-moving news events and their impact on equity markets and commodities. Use this skill when the user requests analysis of major financial news from the past 10 days, wants to understand market reactions to monetary policy decisions (FOMC, ECB, BOJ), needs assessment of geopolitical events' impact on commodities, or requires comprehensive review of earnings announcements from mega-cap stocks. The skill automatically collects news using WebSearch/WebFetch tools and produces impact-ranked analysis reports. All analysis thinking and output are conducted in English.

tradermonty/options-strategy-advisor

Options trading strategy analysis and simulation tool. Provides theoretical pricing using Black-Scholes model, Greeks calculation, strategy P/L simulation, and risk management guidance. Use when user requests options strategy analysis, covered calls, protective puts, spreads, iron condors, earnings plays, or options risk management. Includes volatility analysis, position sizing, and earnings-based strategy recommendations. Educational focus with practical trade simulation.

tradermonty/portfolio-manager

Comprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual stock positions, diversification, and generate rebalancing recommendations. Use when user requests portfolio review, position analysis, risk assessment, performance evaluation, or rebalancing suggestions for their brokerage account.

tradermonty/scenario-analyzer

Skill that analyzes 18-month scenarios from a news headline. Runs the primary analysis with the scenario-analyst agent and obtains a second opinion with the strategy-reviewer agent. Generates a comprehensive English report covering 1st/2nd/3rd-order impacts, recommended stocks, and a critical review. Example: /scenario-analyzer "Fed raises rates by 50bp" Triggers: news analysis, scenario analysis, 18-month outlook, medium-to-long-term investment strategy

tradermonty/sector-analyst

This skill should be used when analyzing sector rotation patterns and market cycle positioning. It fetches sector uptrend data from CSV (no API key required) and optionally accepts chart images for supplementary analysis. Use this skill when the user requests sector rotation analysis, cyclical vs defensive assessment, overbought/oversold identification, or market cycle phase estimation. All analysis and output are conducted in English.

tradermonty/skill-designer

Design new Claude skills from structured idea specifications. Use when the skill auto-generation pipeline needs to produce a Claude CLI prompt that creates a complete skill directory (SKILL.md, references, scripts, tests) following repository conventions.

tradermonty/skill-idea-miner

Mine Claude Code session logs for skill idea candidates. Use when running the weekly skill generation pipeline to extract, score, and backlog new skill ideas from recent coding sessions.

tradermonty/theme-detector

Detect and analyze trending market themes across sectors. Use when user asks about current market themes, trending sectors, sector rotation, thematic investing, what themes are hot or cold, or wants to identify bullish and bearish market narratives with lifecycle analysis.

tradermonty/uptrend-analyzer

Analyzes market breadth using Monty's Uptrend Ratio Dashboard data to diagnose the current market environment. Generates a 0-100 composite score from 5 components (breadth, sector participation, rotation, momentum, historical context). Use when asking about market breadth, uptrend ratios, or whether the market environment supports equity exposure. No API key required.

tradermonty/us-stock-analysis

Comprehensive US stock analysis including fundamental analysis (financial metrics, business quality, valuation), technical analysis (indicators, chart patterns, support/resistance), stock comparisons, and investment report generation. Use when user requests analysis of US stock tickers (e.g., "analyze AAPL", "compare TSLA vs NVDA", "give me a report on Microsoft"), evaluation of financial metrics, technical chart analysis, or investment recommendations for American stocks.

tradermonty/value-dividend-screener

Screen US stocks for high-quality dividend opportunities combining value characteristics (P/E ratio under 20, P/B ratio under 2), attractive yields (3% or higher), and consistent growth (dividend/revenue/EPS trending up over 3 years). Supports two-stage screening using FINVIZ Elite API for efficient pre-filtering followed by FMP API for detailed analysis. Use when user requests dividend stock screening, income portfolio ideas, or quality value stocks with strong fundamentals.

tradermonty/vcp-screener

Screen S&P 500 stocks for Mark Minervini's Volatility Contraction Pattern (VCP) and detect historical VCPs in a single ticker's price path. Identifies Stage 2 uptrend stocks forming tight bases with contracting volatility near breakout pivot points; in historical single-ticker mode walks a multi-year history and emits every VCP that formed with forward-outcome stats (breakout / stop-hit / timeout). Use when user requests VCP screening, Minervini-style setups, tight base patterns, volatility contraction breakout candidates, Stage 2 momentum stock scanning, or historical VCP pattern study on a specific ticker (e.g. FIX, TSLA).

관련 스킬