# TASignal Backtest API

> TASignal Backtest API is a paid API for AI agents from api.youraitools.co, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-23).

Runs a historical backtest of a technical trading strategy (SMA cross, EMA cross, RSI reversion, breakout, or MACD cross) on a crypto asset and returns performance metrics including return, Sharpe ratio, drawdown, and trade history.

## Facts

- Endpoint: GET https://api.youraitools.co/tasignal/v1/backtest?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tasignal-backtest-api-616c2b14
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wL5lSkYMLcM0lTqSN5rTa

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 tasignal-backtest-api-616c2b14
```

Example prompt: Can you backtest a 20/50 EMA crossover strategy on SOL using 4-hour candles over the last 500 bars, long only, with 5 bps fees per side, and show me the total return, Sharpe ratio, and max drawdown?

## When to prefer this

Choose this endpoint when you need a fast, affordable ($0.05) on-demand backtest of a technical strategy on crypto perpetuals/spot using Hyperliquid data. It supports five classic strategies out of the box with full parameterization. Prefer this over building your own backtester when you need quick strategy validation with standard metrics (Sharpe, drawdown, win rate) without managing data pipelines. Not suitable for portfolio-level backtests, options, or strategies requiring custom signal logic beyond the five supported types.

## Known failure modes

- Invalid or unrecognized symbol ticker returns an error
- Unsupported strategy name returns a validation error
- bars parameter outside 100–2000 range may be rejected or clamped
- Insufficient candle data for the requested period may reduce bars_used
- Payment failure (x402) results in 402 response before backtest runs
- Too few trades generated (e.g. only 1-2 crossovers) may yield null profit_factor
- sources_failed array populated if Hyperliquid data fetch partially fails

## How this service works

Crypto strategy backtesting API. Backtest a rule-based strategy (sma_cross, ema_cross, rsi_reversion, breakout, macd_cross) on up to 2000 closed candles of any crypto asset: signals on close, next-open fills, fees per side, long-only or long/short. Not financial advice. Past performance does not guarantee future results. Search intents: crypto backtest api, backtest trading strategy, sma crossover backtest, rsi strategy test, trading strategy api, quant backtesting.

## Output

Returns a JSON object containing: strategy metadata (name, params, direction), market/symbol, timeframe, period covered, number of candles used, trade-by-trade history (entry/exit price, time, return %), aggregate performance stats (total return %, annualized return %, buy-and-hold return %, excess return, Sharpe ratio, max drawdown %, win rate %, profit factor, average trade %, exposure %), equity curve time series, current position status, confidence level, data source, and a disclaimer. Also includes any data sources that failed.

## 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",
      "strategy"
     ],
     "properties": {
      "bars": {
       "type": "integer",
       "description": "Candles to test, 100-2000 (default 500)"
      },
      "fast": {
       "type": "integer",
       "description": "Fast period (sma_cross/ema_cross default 20, macd_cross 12)"
      },
      "slow": {
       "type": "integer",
       "description": "Slow period (sma_cross/ema_cross default 50, macd_cross 26)"
      },
      "lower": {
       "type": "number",
       "description": "RSI entry level for longs (default 30)"
      },
      "upper": {
       "type": "number",
       "description": "RSI entry level for shorts / exit (default 70)"
      },
      "period": {
       "type": "integer",
       "description": "RSI period (default 14) or breakout lookback (default 20)"
      },
      "signal": {
       "type": "integer",
       "description": "MACD signal period (default 9)"
      },
      "symbol": {
       "type": "string",
       "description": "Base asset ticker, e.g. BTC, ETH, SOL, HYPE (BTC-PERP, ETH-USD and SOLUSDT are accepted too)"
      },
      "fee_bps": {
       "type": "number",
       "description": "Fee per side in basis points (default 5)"
      },
      "strategy": {
       "enum": [
        "sma_cross",
        "ema_cross",
        "rsi_reversion",
        "breakout",
        "macd_cross"
       ],
       "type": "string",
       "description": "Strategy rule"
      },
      "direction": {
       "enum": [
        "long_only",
        "long_short"
       ],
       "type": "string",
       "description": "default long_only"
      },
      "timeframe": {
       "enum": [
        "15m",
        "1h",
        "4h",
        "1d"
       ],
       "type": "string",
       "description": "Candle timeframe: 15m, 1h, 4h or 1d (default 1h; risk default 4h)"
      }
     },
     "description": "Search intents: crypto backtest api, backtest trading strategy, sma crossover backtest, rsi strategy test, trading strategy api, quant backtesting"
    }
   },
   "additionalProperties": false
  },
  "o
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "tier": "backtest",
  "market": "SOL",
  "result": {
   "period": {
    "to": "2026-10-22T16:00:00.000Z",
    "bars": 450,
    "from": "2026-08-08T16:00:00.000Z"
   },
   "trades": 2,
   "assumptions": "Signals on candle close, fills at the next candle open, fees per side as set; no slippage, funding, borrow or liquidity limits; position size 100% of equity, no leverage.",
   "last_trades": [
    {
     "exit": 99.676,
     "side": "long",
     "entry": 76.373,
     "exit_time": "2026-09-10T16:00:00.000Z",
     "entry_time": "2026-08-08T16:00:00.000Z",
     "return_pct": 30.447
    },
    {
     "exit": 115.84,
     "side": "long",
     "entry": 105.74,
     "exit_time": "2026-10-07T20:00:00.000Z",
     "entry_time": "2026-09-18T12:00:00.000Z",
     "return_pct": 9.497
    }
   ],
   "equity_curve": [
    [
     "2026-08-08T16:00:00.000Z",
     0.99632
    ],
    [
     "2026-08-23T16:00:00.000Z",
     1.24486
    ],
    [
     "2026-09-07T16:00:00.000Z",
     1.36524
    ],
    [
     "2026-09-22T16:00:00.000Z",
     1.45808
    ],
    [
     "2026-10-07T16:00:00.000Z",
     1.42764
    ],
    [
     "2026-10-22T12:00:00.000Z",
     1.42693
    ]
   ],
   "exposure_pct": 69.78,
   "win_rate_pct": 100,
   "avg_trade_pct": 19.972,
   "profit_factor": null,
   "sharpe_annual": 3.869,
   "current_position": "flat",
   "max_drawdown_pct": -10.327,
   "total_return_pct": 42.693,
   "fees_bps_per_side": 5,
   "annualized_return_pct": 464.18,
   "buy_and_hold_return_pct": 36.933,
   "excess_vs_buy_and_hold_pct": 5.759
  },
  "source": "hyperliquid",
  "symbol": "SOL",
  "strategy": {
   "name": "ema_cross",
   "params": {
    "fast": 20,
    "slow": 50
   },
   "direction": "long_only"
  },
  "timeframe": "4h",
  "checked_at": "2026-10-22T19:00:54.904Z",
  "confidence": "high",
  "disclaimer": "Not financial advice. Past performance does not guarantee future results. Technical indicators, risk metrics and backtests describe historical prices only; they are not predictions or trade recommendations. TASignal never trades, holds funds or keys.",
  "candles_used": 500,
  "sources_failed": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tasignal-backtest-api-616c2b14/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.youraitools.co](https://www.zero.xyz/host/api.youraitools.co/llms.txt)
