Weekly Performance Digest

作者 tradermontyeab8d5cb97b9无许可证2.9K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库3天前更新

Generate a weekly performance summary from closed trader-memory-core theses — win rate, expectancy, profit factor, R-multiple, MAE/MFE, and win/loss pattern analysis by source skill, exit reason, thesis type, sector, and mechanism. No API required; pure local calculation.

AI 生成的概览

将已平仓的交易论点汇总为每周绩效报告,包含指标、模式分解和经验教训。

功能
读取 trader-memory-core 状态目录中状态为 CLOSED 的论点 YAML 文件,计算每周绩效指标,如胜率、期望值、盈亏比、R 倍数和 MAE/MFE。它按来源技能、退出原因、论点类型、板块、机制标签和筛选评级分解结果,并列出最大盈利、最大亏损和流程改进。它会将 JSON 记录和人类可读的 Markdown 报告写入输出目录。
适用场景
适合在交易周结束时回顾已平仓头寸的整体已实现表现。也适合衡量胜率和期望值、查看哪些维度带来盈利或亏损,或为月末回顾或事后复盘提供输入。
运行要求
需要 Python 3.9+ 和 PyYAML,以及包含论点 YAML 文件的 trader-memory-core 状态目录。无需 API 密钥或网络访问。该技能附带可执行脚本,包括摘要生成器及其测试。

Weekly Performance Digest

Overview

Weekly Performance Digest aggregates the trades you closed during a week into a single performance report. It reads CLOSED theses tracked by trader-memory-core (state/theses/th_*.yaml), computes headline metrics (win rate, expectancy, profit factor, R-multiple, MAE/MFE), breaks results down across several pattern dimensions (source skill, exit reason, thesis type, sector, mechanism tag, screening grade), and surfaces the week's biggest winners, losers, and lessons. Output is a JSON record plus a human-readable Markdown report. Pure calculation — no API key required.

When to Use

  • At the end of a trading week to review aggregate realized performance
  • To measure win rate and expectancy across all closed positions
  • To see which source skills, exit reasons, sectors, or mechanisms drove wins vs losses
  • To feed a month-end review (combine four weekly digests) or a postmortem
  • For a quick "what worked / what didn't" snapshot grounded in real closed trades

When Not to Use

  • For a single-trade deep review — use trade-performance-coach
  • For signal-level true/false-positive classification — use signal-postmortem
  • For buy/sell recommendations or position sizing — this skill is descriptive only

Prerequisites

  • Python 3.9+ with PyYAML (already a repo dependency)
  • A trader-memory-core state directory of thesis YAML files (state/theses/)
  • No API key required

Workflow

Step 1: Run the digest for a week

bash
python3 skills/weekly-performance-digest/scripts/generate_weekly_digest.py \  --state-dir state/theses \  --from-date 2026-06-13 --to-date 2026-06-20 \  --output-dir reports/ -v

Defaults: --state-dir state/theses, --from-date = 7 days before --to-date, --to-date = today, --output-dir reports/. With no date flags it digests the trailing 7 days.

Step 2: Read the report

The run writes reports/weekly_digest_<to-date>.json and reports/weekly_digest_<to-date>.md. Review the Markdown for the executive summary, metrics table, pattern breakdowns, and top winners/losers; consume the JSON downstream.

Step 3 (optional): Feed downstream

Combine several weekly JSON digests for a monthly review, or pass the JSON to a postmortem/coach step. The skill is descriptive — act on its findings via your normal review process.

How It Works

  • Trade selection. A trade counts in a week if its exit.actual_date falls in [from-date, to-date] and status == CLOSED.
  • Win/loss. outcome.pnl_dollars > 0 is a winner, < 0 a loser, == 0 breakeven; win_rate = winners / total_trades.
  • R-multiple. pnl_dollars / ((entry.actual_price − exit.stop_loss) × position.shares). (Stop-loss is read from exit.stop_loss, per the real thesis schema.)
  • Double-counting safeguard. A CLOSED thesis's outcome.pnl_dollars is the cumulative realized P&L across all trims plus the final leg. Headline metrics use that cumulative value over CLOSED theses only. The separate partial_trims block scans status_history[] of PARTIALLY_CLOSED theses only (still open) and is reported for information — it is never added into the headline totals/win-rate. A position trimmed in week 1 then closed in week 2 therefore shows as a partial trim in week 1 and inside week 2's CLOSED headline; that is intended, not a duplicate.

Output Format

JSON (weekly_digest_<to-date>.json)

json
{  "schema_version": "1.0",  "report_type": "weekly_performance_digest",  "period": {"from": "2026-06-13", "to": "2026-06-20"},  "generated_at": "2026-06-20T21:39:07Z",  "summary": {    "total_trades": 2, "winners": 1, "losers": 1, "breakeven": 0,    "win_rate": 0.5, "expectancy": 25.0, "profit_factor": 2.0,    "total_realized_pnl": 50.0, "total_realized_pnl_pct": 4.17  },  "metrics": {    "avg_winner": 100.0, "avg_loser": -50.0,    "largest_winner": 100.0, "largest_loser": -50.0,    "avg_holding_days_winners": 9.0, "avg_holding_days_losers": 6.0,    "r_multiple_avg": 0.25, "r_multiple_stdev": 1.06,    "avg_mae_pct": -3.75, "avg_mfe_pct": 4.5  },  "pattern_analysis": {    "by_source_skill": {"...": {"wins": 1, "losses": 0, "total": 1, "win_rate": 1.0}},    "by_exit_reason": {}, "by_thesis_type": {}, "by_sector": {},    "by_mechanism_tag": {}, "by_screening_grade": {}  },  "partial_trims": {"count": 0, "total_realized_pnl": 0.0, "trims": []},  "lessons": {"top_wins": [], "top_losses": [], "process_improvements": []}}

Markdown (weekly_digest_<to-date>.md)

Sections: # Weekly Performance Digest, ## Executive Summary, ## Performance Metrics, ## Pattern Analysis, ## Lessons Learned (### Top Winners / ### Top Losers / ### Process Improvements).

An empty week still produces a valid report with zeroed metrics (exit code 0).

Resources

  • scripts/generate_weekly_digest.py — digest generator (JSON + Markdown)
  • references/weekly-digest-metrics.md — metric formulas and interpretation

Key Principles

  1. Closed trades only for headline numbers — cumulative outcome.*, keyed on exit date.
  2. No double-counting — partial trims are informational and excluded from totals.
  3. Pattern attribution — every win/loss is attributed across multiple dimensions.
  4. Descriptive, not prescriptive — the digest reports; you decide.

来源与署名

来源:tradermonty/claude-trading-skills位于skills/weekly-performance-digest提交eab8d5c

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 tradermonty/claude-trading-skills 的技能

Trade Performance Coach

tradermonty

审查已记录的交易,评估流程遵守、风险纪律、执行质量与行为模式,并生成教练报告。

包含脚本
Business & Finance2.9K3天前更新

Strategy Pivot Designer

tradermonty

检测回测迭代停滞,并为交易策略生成结构不同的策略转向方案。

包含脚本
Business & Finance2.9K3天前更新

Skill Designer

tradermonty

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.

包含脚本
待分类2.9K3天前更新

Residual Edge Analyzer

tradermonty

Separate a strategy return series into declared baseline exposure and residual edge with returns-based OLS attribution, HAC inference, rolling stability, alternate-baseline sensitivity, and regime breakdowns. Use when evaluating whether backtest, out-of-sample, or live returns contain independent alpha beyond market, equal-weight, momentum, sector, or user-supplied factor returns; when explaining whether a drawdown came from baseline exposure or strategy-specific behavior; or when a strategy needs an attribution quality gate after backtesting. Do not use for holdings-based Brinson attribution, feature-level Shapley explanations, or analysis from summary metrics without a dated return series.

包含脚本
待分类2.9K3天前更新

Pre Trade Discipline Gate

tradermonty

离线交易前检查清单闸门,批准、复核或阻止计划中的手动订单并记录决策。

包含脚本
Business & Finance2.9K3天前更新

Manifoldbt Backtester

tradermonty

Runs a declarative strategy spec over OHLCV bars with the manifoldbt Rust engine, pairs the fill log into round trips, and emits the eight inputs the backtest-expert skill scores. Use when the user wants to execute a backtest, measure a rule they have described, obtain win rate / average win / average loss / max drawdown from real bars, or feed backtest-expert with measured numbers instead of estimates.

包含脚本
待分类2.9K3天前更新