A股策略回测
backtest_strategyBacktest simple stock strategies such as moving average crossover, MACD, and KDJ. Input a stock symbol and strategy type to receive performance metrics like total return, maximum drawdown, and win rate.
Instructions
对股票进行简单策略回测,支持均线交叉、MACD、KDJ等策略,返回收益率、最大回撤、胜率等指标。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | 股票代码(纯数字或字母组合,如600519、AAPL、HK00700) | |
| strategy | No | 策略类型: 'ma_cross'(均线交叉), 'macd'(MACD金叉死叉), 'kdj'(KDJ超买超卖), 'rsi'(RSI超买超卖), 'boll'(布林带突破) | ma_cross |
| start_date | No | 开始日期,格式: 20240101,默认一年前 | |
| end_date | No | 结束日期,格式: 20241231,默认今天 | |
| initial_capital | No | 初始资金(元) | |
| ma_short | No | 短期均线周期(ma_cross策略) | |
| ma_long | No | 长期均线周期(ma_cross策略) |