界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

report-generation

report-generation

【数据与研究】Generates structured trading performance reports. Includes performance metrics summary, equity curve, trade-by-trade log, monthly returns heatmap, and comparative benchmark analysis. Trigger when the user wants a summary or report of trading results.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: report-generation description: Generates structured trading performance reports. Includes performance metrics summary, equity curve, trade-by-trade log, monthly returns heatmap, and comparative benchmark analysis. Trigger when the user wants a summary or report of trading results. metadata: hermes: tags: [report, performance, trading, metrics, summary] category: analysis

Report Generation

Generates comprehensive trading performance reports.

Real Code Reference

  • tradinglearn/backtest/backtester.py — generate_report() (summary) and generate_detailed_report() (full metrics)
  • tradinglearn/utils/parameter_optimizer.py — save_optimization_results() → CSV with all param combos
  • tradinglearn/reports/ — output directory for generated reports

Report Sections

  1. Executive Summary — total return, Sharpe, max drawdown, win rate, CAGR
  2. Equity Curve — portfolio value time series with key event annotations
  3. Trade Log — each trade: entry/exit dates, prices, P&L, holding period
  4. Monthly Returns — calendar heatmap
  5. Drawdown Analysis — top-5 drawdowns: peak, trough, recovery, duration
  6. Benchmark Comparison — vs. market index (e.g. 000300 CSI 300)

Output Formats

  • Console: bt.generate_detailed_report() prints formatted text
  • CSV: trade log + monthly returns for spreadsheets
  • DataFrame: bt.get_performance() / bt.get_portfolio() / bt.get_signals()

Trade Log Schema

trade_id, symbol, entry_date, exit_date, entry_price, exit_price,
direction, quantity, pnl, pnl_pct, holding_days, exit_reason
我的收藏