# Orchard Data Backtest

> Orchard Data Backtest is a paid API for AI agents from orchard-data.letom1176.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-14).

Backtests a rule-based entry signal (e.g. RSI2, IBS, dip-from-high) on a given ticker symbol over historical data and returns win rate, trade count, and strategy vs buy-and-hold comparison.

## Facts

- Endpoint: GET https://orchard-data.letom1176.workers.dev/api/backtest
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/orchard-data-backtest-a9dd719a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2ICLfhRUjmQUwvC_xag7S

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 orchard-data-backtest-a9dd719a
```

Example prompt: Can you backtest an RSI2-below-10 entry signal on SPY with a 5-day max hold and tell me the win rate, number of trades, and how it compares to just buying and holding SPY?

## When to prefer this

Choose this endpoint when you need a quick, quantitative historical backtest of a specific rule-based entry signal (RSI2, IBS, dip-from-high, SMA cross, gap-down, down-days) on a U.S. equity ticker. It is purpose-built for signal validation with plain-English verdict summaries, making it ideal for AI agents that need to reason about whether a trading rule has historically worked. Prefer this over generic data APIs when you want pre-computed win rates, strategy multiples, and buy-and-hold comparisons in a single call rather than raw price data requiring your own analysis.

## Known failure modes

- Missing required query params (symbol, entry, threshold) returns 400 or error JSON
- Invalid entry type string not in enum returns error
- Symbol not found or unsupported ticker may return empty results or error
- Payment not completed via x402 (USDC on Base) returns 402 Payment Required
- Hold days outside 1-30 range may return validation error
- Threshold value out of meaningful range for chosen entry type may produce zero trades

## How this service works

Market data for AI agents, paid per-call via x402 (USDC on Base). Free index at /, free spec here.

## Output

Returns a JSON object with the backtest spec (symbol, entry rule, threshold, hold days), a verdict block with a plain-English honest read and whether the first/second half of history agree on direction, and full-period statistics including number of trades, win rate, strategy multiple (cumulative return), and buy-and-hold multiple for the same symbol over the same 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "symbol",
      "entry",
      "threshold"
     ],
     "properties": {
      "entry": {
       "type": "string",
       "description": "rsi2_below | rsi14_below | ibs_below | dip_from_high20 | down_days | sma_cross_up | gap_down"
      },
      "symbol": {
       "type": "string",
       "description": "Ticker, e.g. SPY, NVDA"
      },
      "stop_pct": {
       "type": "string",
       "description": "Optional stop loss %"
      },
      "hold_days": {
       "type": "string",
       "description": "Max hold in trading days (1-30), default 5"
      },
      "threshold": {
       "type": "string",
       "description": "Rule threshold, e.g. 10 for rsi2_below"
      },
      "target_pct": {
       "type": "string",
       "description": "Optional profit target %"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "spec": {
   "entry": "rsi2_below",
   "symbol": "SPY",
   "hold_days": 5,
   "threshold": 10
  },
  "verdict": {
   "honest_read": "...",
   "halves_agree_on_sign": true
  },
  "full_period": {
   "n_trades": 118,
   "win_rate": 0.66,
   "strategy_multiple": 2.1,
   "buy_hold_multiple_same_symbol": 2.9
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/orchard-data-backtest-a9dd719a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from orchard-data.letom1176.workers.dev](https://www.zero.xyz/host/orchard-data.letom1176.workers.dev/llms.txt)
