择时回测(单个标的买卖规则)
backtest_timing对单个 A 股股票、场内基金(ETF / LOF)、美股、港股或期货品种(主力连续,可做空)按入场、出场规则回测(日线),可加止盈止损,同时给出同区间买入持有的对比。规则用 EasyQuant DSL 写:indicators 定义指标,entry / exit 是规则树(类型与参数见 catalog)。回答用户时只能引用返回的数字;不对任何个股给买卖建议。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>",
"indicators": "<indicators>"
},
"name": "backtest_timing"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | 回测结束日 YYYY-MM-DD,默认最近一个交易日 | |
| code | Yes | 标的代码:A 股 / ETF 带交易所后缀,例如 600519.SH、510300.SH;期货写品种代码(按主力连续),例如 RB、IF、AU;美股、港股要同时传 market,code 写 AAPL、00700.HK | |
| exit | No | 出场规则树,写法同 entry | |
| entry | No | 入场规则树,例如 {"type": "CROSS_UP", "left": {"ind": "fast"}, "right": {"ind": "slow"}} | |
| exits | No | 止盈止损(可选) | |
| start | No | 回测起始日 YYYY-MM-DD,默认 3 年前;最长 5 年 | |
| market | No | 只在美股、港股时填(us_equity / hk_stock);A 股、ETF、期货按代码自动识别 | |
| indicators | Yes | 指标定义:名字 → {type, 参数...},例如 {"fast": {"type": "SMA", "period": 20}} | |
| short_exit | No | 平空规则树(仅期货),写法同 entry | |
| short_entry | No | 开空规则树(仅期货),写法同 entry;与 entry 同时写即多空双向 | |
| capital_budget_pct | No | 仅期货:资金预算 %,默认 100(合约名义价值约等于资金,不加杠杆);最多 300 即 3 倍杠杆 |