Backtest a screening strategy
run_backtestSaves a strategy to the user's CubeLV account and backtests it on Taiwan stocks over a date range, waiting up to about 90 seconds for the result. Returns total and annual return, max drawdown, win rate and trade count, or the backtest id when it is still running. The strategy stays in CubeLV (without notifications) and can be deleted there or with delete_alert.
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": {
"strategy": "<strategy>",
"from_date": "<from_date>"
},
"name": "run_backtest"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language for data labels (industries, statement items, categories) and links: en, ja, ko or vi; default en | |
| sizing | No | Position sizing, default {"initial_cash": 1000000, "type": "amount", "value": 100000, "max_positions": 10} (TWD) | |
| to_date | No | End date YYYYMMDD; default the latest trading day | |
| strategy | Yes | Strategy: {"name": "...", "side": "long", "universe": {...}, "entry_rule": {...}, "exit_rule": {"any": [{"indicator": "return_since_entry", "op": "<=", "value": -7}, {"indicator": "return_since_entry", "op": ">=", "value": 20}]}, "sort": {...}}; universe and rules are written as in screen_stocks | |
| from_date | Yes | Start date YYYYMMDD |