2.8 KiB
2.8 KiB
name, description
| name | description |
|---|---|
| stock-backtest | Design, run, and interpret strategy backtests for A-share stocks |
What I Do
Guide the agent through backtesting trading strategies:
- Help design strategy rules from user descriptions
- Run backtests on historical data
- Interpret results and identify potential issues
- Suggest improvements
Capital Context (CRITICAL)
The user has ~5万 RMB capital. Backtest interpretation must be capital-aware:
- When presenting metrics, translate key numbers to the user's context:
- "Annualized return 15% = ¥7,500 on 5万"
- "Max drawdown 12% = ¥6,000 worst-case loss"
- "Average win ¥800, average loss ¥1,200 per trade"
- Assess whether a strategy is practically usable with 5万 considering position sizing constraints
- Flag if a strategy requires more positions than 5万 can support
Key Backtest Metrics
- Cumulative return: total return over the period
- Annualized return: normalized yearly return (translate to ¥ on 5万)
- Win rate: percentage of profitable trades
- Max drawdown: worst peak-to-trough decline (translate to ¥)
- Sharpe ratio: risk-adjusted return
- Benchmark comparison: vs CSI 300 index
Strategy Parameters
Common strategy elements to help users define:
- Entry conditions (e.g., MA crossover, breakout, pullback)
- Exit conditions (e.g., stop loss %, take profit %, trailing stop, time-based)
- Position sizing (e.g., fixed %, Kelly fraction)
- Test period and stock universe
When to Use Me
Use when the user asks to:
- Backtest a trading strategy
- Verify a strategy's historical performance
- Compare multiple strategies
- Evaluate whether a strategy is worth using
Workflow
- Clarify strategy rules with user
- Translate rules into testable parameters
- Run backtest via
stock-backtesttools - Present results with interpretation:
Output Format
- Strategy Summary: rules in plain language
- Performance Metrics: all key metrics in table form
- Capital Context Translation:
Metric Value On 5万 Capital Annualized Return 18% ¥9,000/year Max Drawdown 15% ¥7,500 worst case Avg Win per Trade ¥450 — Avg Loss per Trade ¥600 — - Equity Curve Description: shape, drawdown periods, recovery time
- Benchmark Comparison: outperformance/underperformance vs CSI 300
- Practicality Assessment for 5万:
- Can the user afford the position sizes?
- Does the strategy require too many concurrent positions?
- Is the max drawdown psychologically tolerable?
- Potential Concerns: overfitting, look-ahead bias, survivorship bias, regime dependence
Risk Disclaimer
Always remind: backtest results reflect historical data. Live performance will differ. Strategies can fail in new market regimes. The user bears all trading risk.