Skip to main content
Glama

Backtest a simple strategy on real history

qmax_backtest
Read-onlyIdempotent

Replays a strategy over real hourly trade data with the venues' real fees and reports what it would have done: final value, return, buy-and-hold comparison, max drawdown, fees paid, trades. Decisions are made on an hour's close and filled at the next hour's open; hours with no trades cannot be traded.

Strategies: 'hold' (buy once, hold), 'dca' (spend amountQu every everyHours), 'bands' (buy fractionPct of the QU when the price is bandPct below its lookbackHours average, sell fractionPct of the holding when above, with a cooldown). The result's 'warnings' note that there is no order book depth in the history, so large amounts are optimistic, and QSwap's flat 100,100 QU fee can swallow small trades. Past results do not predict future ones.

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": {
      "asset": "<asset>",
      "starting_qu": "<starting_qu>",
      "strategy": "<strategy>"
    },
    "name": "qmax_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
assetYesAsset symbol, for example CFB or QDOGE (case does not matter). qmax_list_assets lists the tradable symbols.
rangeNoHow much history to replay90d
venueNoWhich market's prices: QX (order book), QSwap (pool), 'all' (treat both as one market), or 'auto' (the market the live price comes from).auto
strategyYesThe rule to replay: hold needs nothing more; dca needs amountQu and everyHours; bands needs lookbackHours, bandPct, fractionPct and cooldownHours.
starting_quYesQU to start with, e.g. 10000000

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / range / description
      Added value: +"How much history to replay"
    • addedInput schema / properties / strategy / description
      Added value: +"The rule to replay: hold needs nothing more; dca needs amountQu and everyHours; bands needs lookbackHours, bandPct, fractionPct and cooldownHours."
    • addedInput schema / properties / strategy / properties / type / description
      Added value: +"hold: buy once and keep. dca: buy a fixed amount at intervals. bands: buy below and sell above a moving average."
  2. Changed1 schema field changed
    • changedInput schema / properties / asset / description
      Previous value: -"Asset symbol, for example CFB or QDOGE (case does not matter). Use qmax_list_assets to find one."New value: +"Asset symbol, for example CFB or QDOGE (case does not matter). qmax_list_assets lists the tradable symbols."
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld, so the bar is lower, and the description still adds real substance: decisions at an hour's close are filled at the next hour's open, hours with no trades are skipped, no order-book depth means large amounts are optimistic, and QSwap's flat 100,100 QU fee can swallow small trades. It stops short of stating cost/runtime expectations for replaying 90 days of hourly data.

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

Conciseness4/5

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

Front-loaded with what is replayed and what comes back, then strategy variants, then caveats; every sentence carries information. Slightly dense and the 'spend amountQu every everyHours' typo is the only stumble.

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

Completeness5/5

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

No output schema exists, and the description compensates by enumerating the return fields (final value, return, buy-and-hold comparison, max drawdown, fees paid, trades, warnings). Combined with fill mechanics and the strategy-object semantics, an agent has everything needed to call a 5-parameter tool with a nested object correctly.

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

Parameters4/5

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

Schema coverage is 100%, so 3 is the floor. The description earns above that by explaining the mechanics behind the nested strategy fields — bands buys fractionPct of QU when price is bandPct below the lookbackHours average, sells when above, with a cooldown — which is more than the terse per-field schema strings convey.

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 verb and resource: replays a named strategy over real hourly trade data to report hypothetical performance. No sibling tool (qmax_get_price_history, qmax_get_candles, qmax_get_quote) does simulation, so the boundary is clear without naming them.

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

Usage Guidelines3/5

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

Usage is implied — you call it to evaluate how a strategy would have performed — but the description never states when to prefer it over pulling raw history with qmax_get_candles or qmax_get_price_history, nor any exclusions. The strategy-selection guidance is operational detail, not tool routing.

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.