Backtest a simple strategy on real history
qmax_backtestReplays 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
| Name | Required | Description | Default |
|---|---|---|---|
| asset | Yes | Asset symbol, for example CFB or QDOGE (case does not matter). qmax_list_assets lists the tradable symbols. | |
| range | No | How much history to replay | 90d |
| venue | No | Which market's prices: QX (order book), QSwap (pool), 'all' (treat both as one market), or 'auto' (the market the live price comes from). | auto |
| strategy | Yes | The rule to replay: hold needs nothing more; dca needs amountQu and everyHours; bands needs lookbackHours, bandPct, fractionPct and cooldownHours. | |
| starting_qu | Yes | QU to start with, e.g. 10000000 |