Skip to main content
Glama

Taiwan Futures

Backtest a futures strategy

run_backtest

Saves a futures strategy to the user's CubeLV account and backtests it on 1 to 5 TAIFEX continuous codes with daily or intraday bars, 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": {
      "symbols": "<symbols>",
      "entry_rule": "<entry_rule>",
      "from_date": "<from_date>"
    },
    "name": "run_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoLanguage for data labels (industries, statement items, categories) and links: en, ja, ko or vi; default en
nameNoName shown in CubeLV
sideNolong, short (entry_rule opens shorts) or both (needs short_entry_rule); default long
exitsNoIntrabar exits: {"stop_loss": {"percent": 1.5}, "take_profit": {"risk_reward": 2}, "trailing_stop": {"atr": 2}}
sizingNoPosition sizing, default {"initial_cash": 10000000, "type": "quantity", "value": 1, "max_positions": 1} (contracts, TWD; a position uses the full contract value, e.g. TXF about 200 TWD per point)
sessionNoTrading session of the bars; default all
symbolsYes1 to 5 TAIFEX continuous codes, e.g. ["TXF1"] or ["MXF1"]
to_dateNoEnd date YYYYMMDD; default the latest trading day
intervalNoBar interval; default 1d
exit_ruleNoExit conditions, e.g. {"any": [{"indicator": "return_since_entry", "op": "<=", "value": -2}]}
from_dateYesStart date YYYYMMDD
entry_ruleYesEntry conditions on bar indicators, e.g. {"all": [{"indicator": "close", "op": "cross_above", "value": {"indicator": "ma", "params": {"n": 20}}}]}; indicators include close, ma (params n), rsi, return_since_entry and bars_since_entry; rules nest with all/any (no rank or percentile)
short_exit_ruleNoside both: exit conditions for shorts
short_entry_ruleNoside both: entry conditions for shorts

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations mark this as a non-read-only, non-idempotent write, and the description adds real substance beyond that: the strategy persists in the user's account without notifications, may still be running after the wait and then returns only a backtest id, and can be removed later. It does not say whether repeated identical calls create duplicate saved strategies, which matters given idempotentHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences ordered by importance: what it does and its limits, what it returns, and the lifecycle of the saved strategy. Every clause carries information; nothing is redundant padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter tool with nested rule objects and no output schema, the description supplies the return fields (total/annual return, drawdown, win rate, trade count, or a backtest id) and the persistence side effect, which is the critical missing structured information. Error handling and behavior on invalid rule structures are not covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with detailed per-parameter descriptions including defaults, enums, and rule nesting syntax, so the description cannot add much. It reinforces symbol limits and bar type but adds no meaning the schema does not already carry, making the baseline 3 correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific compound verb+resource: saves a futures strategy to CubeLV and backtests it on 1-5 TAIFEX continuous codes with daily or intraday bars. No sibling does backtesting, and the difference from delete_alert is made explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete operating context (symbol count limit, bar granularity, ~90s wait) and names delete_alert as the cleanup path. It does not state when a caller should avoid this tool, but there is no competing backtest sibling against which exclusion would be needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources