Skill: Report Generation
Purpose
Generate comprehensive trading reports in multiple formats (Markdown, CSV, HTML). Combines data from analysis, portfolio, and journal skills to create professional trading reports.
When to Use
- •Creating daily/weekly/monthly performance reports
- •Generating tax documentation
- •Preparing investor updates
- •Documenting trading activity
- •Compliance and record-keeping
Workflow
Step 1: Generate Report
typescript
import { generateReport } from './skills/report-generation';
const report = await generateReport({
type: 'performance',
period: 'monthly',
format: 'markdown',
includeCharts: true,
includeTransactions: true,
});
console.log(report.content);
console.log('Saved to:', report.filePath);
Step 2: Customize Content
typescript
const customReport = await generateReport({
type: 'custom',
sections: ['summary', 'holdings', 'trades', 'lessons'],
title: 'Q4 Trading Review',
author: 'Trading Team',
});
Report Types
| Type | Description | Contents |
|---|---|---|
| performance | Overall trading performance | P&L, win rate, metrics |
| portfolio | Portfolio holdings report | Assets, allocation, value |
| transactions | Transaction history | All trades with details |
| tax | Tax-ready export | Gains, losses, cost basis |
| journal | Trading journal summary | Trades, lessons, patterns |
| daily | Daily recap | Today's activity |
| weekly | Weekly summary | Week's performance |
| monthly | Monthly report | Full month analysis |
| custom | Custom sections | User-selected sections |
Configuration
typescript
interface ReportConfig {
type: ReportType;
period?: 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly' | 'all';
format?: 'markdown' | 'csv' | 'html' | 'json';
outputPath?: string;
title?: string;
author?: string;
sections?: string[];
includeCharts?: boolean;
includeTransactions?: boolean;
symbols?: string[];
}
Output Formats
Markdown
Professional document with headers, tables, and formatting.
CSV
Spreadsheet-compatible data export for analysis.
HTML
Styled web page with interactive elements.
JSON
Structured data for programmatic use.
Example: Monthly Performance Report
typescript
const report = await generateReport({
type: 'monthly',
format: 'markdown',
title: 'December 2024 Trading Report',
author: 'Trading Bot',
includeCharts: true,
});
/* Output:
# December 2024 Trading Report
Generated: 2024-12-31T00:00:00Z
Author: Trading Bot
## Executive Summary
- Total P&L: $2,450.00 (+12.3%)
- Win Rate: 68%
- Total Trades: 45
## Performance Metrics
| Metric | Value |
|--------|-------|
| Sharpe Ratio | 1.8 |
| Max Drawdown | 8.2% |
...
*/
Best Practices
- •Consistent scheduling - Generate reports on regular schedule
- •Archive old reports - Keep historical records
- •Include context - Add market conditions and notes
- •Use appropriate format - Markdown for reading, CSV for analysis
- •Verify accuracy - Cross-check key figures
Related Skills
- •
data-analysis- Data for reports - •
portfolio-analysis- Portfolio metrics - •
trading-journal- Trade documentation