# 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.

- Skill: `lisonevf/report-generation` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lisonevf/report-generation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lisonevf/report-generation/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: lisonevf (https://skillmd.com/u/lisonevf)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/lisonevf/report-generation

---


# 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
```

