| name | doc-generation |
| description | Generates documentation for trading and financial code: strategy documentation, API references, usage examples, README files, and inline code comments. Trigger when the user wants to document trading code or generate project documentation. |
Documentation Generation
Creates clear, structured documentation for financial codebases.
Real Code Reference
tradinglearn/main.py — interactive CLI entry, good candidate for README docs
tradinglearn/strategies/macd_strategy.py — needs strategy documentation (params, logic, usage)
tradinglearn/pytdx2/CLAUDE.md — example of good project-level documentation
tradinglearn/pytdx2/demo.py — usage examples for all API calls
Output Types
- Strategy docs: parameters, logic description, assumptions, expected performance
- API docs: function signatures with parameter descriptions, return types, examples
- README: project overview, quick start, installation, dependencies
- Inline comments: explain non-obvious financial logic, formula references
Strategy Documentation Template
# Strategy Name
## Overview
One-sentence description of the core idea.
## Signal Logic
How entry/exit signals are generated, with formulas.
## Parameters
| Parameter | Default | Description |
|-----------|---------|-------------|
| fast | 12 | Short EMA period |
## Risk Management
Stop-loss, position sizing, and risk controls.
## Usage
\`\`\`python
strategy = MyStrategy(param=value)
signals = strategy.generate_signals(data)
\`\`\`