# QuantOracle Backtest Strategy

> QuantOracle Backtest Strategy is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Runs a quantitative backtesting simulation on a given trading strategy against historical data and returns performance metrics

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/backtest/strategy
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-quantoracle-dev-9185cd76
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sUTM9tjhmIQFdd5Z8zhy1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-quantoracle-dev-9185cd76 -d '<json body>'
```

Example prompt: Backtest a simple 50/200-day moving average crossover strategy on BTC/USD using daily data from January 2020 through December 2023, and give me the total return, max drawdown, and Sharpe ratio.

## When to prefer this

Choose this endpoint when you need to evaluate the historical performance of a defined algorithmic trading strategy before deploying it live. It is best suited for quantitative traders and AI agents that need to validate strategy viability, measure risk-adjusted returns, or compare strategy variants using backtesting — rather than live signal generation or portfolio management.

## Known failure modes

- Invalid strategy definition or unsupported strategy type returns 400 error
- Asset symbol not found or unsupported in historical database returns 404
- Date range out of bounds or insufficient historical data returns 422
- Malformed request body missing required strategy parameters returns 400
- Service timeout for very large date ranges or complex strategies
- Payment not processed or insufficient balance returns 402

## How this service works

QuantOracle: backtest/strategy

## Output

Returns historical backtest performance metrics for the submitted strategy, including total return, annualized return, maximum drawdown, win rate, and possibly an equity curve or trade-by-trade breakdown over the specified historical period.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "title": "BacktestStrategyIn",
     "required": [
      "prices"
     ],
     "properties": {
      "params": {
       "type": "object",
       "title": "Params",
       "description": "Strategy params. SMA: {fast,slow}. RSI: {period,oversold,overbought}. Momentum: {lookback}. Bollinger: {period,std}.",
       "additionalProperties": true
      },
      "prices": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "title": "Prices",
       "minItems": 30,
       "description": "Price history (daily closes, oldest first)"
      },
      "strategy": {
       "type": "string",
       "title": "Strategy",
       "default": "sma_crossover",
       "description": "sma_crossover | rsi_mean_reversion | momentum | bollinger_breakout"
      },
      "slippage_bps": {
       "type": "number",
       "title": "Slippage Bps",
       "default": 5,
       "minimum": 0,
       "description": "One-way slippage in basis points"
      },
      "commission_bps": {
       "type": "number",
       "title": "Commission Bps",
       "default": 5,
       "minimum": 0,
       "description": "Round-trip commission in basis points"
      },
      "initial_capital": {
       "type": "number",
       "title": "Initial Capital",
       "default": 10000,
       "description": "Starting capital",
       "exclusiveMinimum": 0
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-9185cd76/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.quantoracle.dev](https://www.zero.xyz/host/api.quantoracle.dev/llms.txt)
