# TASignal Backtest

> TASignal Backtest is a paid API for AI agents from tasignal.agentgate.workers.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-30).

Runs rule-based strategy backtests (SMA/EMA cross, RSI reversion, Donchian breakout, MACD cross) on crypto assets using historical candle data, returning trade list, equity curve, and performance metrics.

## Facts

- Endpoint: GET https://tasignal.agentgate.workers.dev/v1/backtest?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tasignal-backtest-ad7e2872
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GTaH0eIfUMn0-cfj1-Kf4

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-ad7e2872
```

Example prompt: Run a backtest on SOL using an EMA cross strategy with fast period 20 and slow period 50 on 4-hour candles, long only, with 5 bps fees per side, over the last 500 bars — give me the total return, Sharpe ratio, max drawdown, and trade list.

## When to prefer this

Use this endpoint when you need a rapid quantitative backtest of a rule-based strategy on a crypto asset with realistic fee modeling, next-open fill assumptions, and standard performance metrics (Sharpe, drawdown, win rate) — especially when you want to compare strategy performance vs. buy-and-hold. Prefer this over manual analysis when the user wants to evaluate SMA/EMA cross, RSI reversion, Donchian breakout, or MACD cross rules across multiple timeframes without building their own data pipeline.

## Known failure modes

- Invalid or unrecognized symbol returns error — use base ticker like BTC, ETH, SOL
- Unsupported strategy enum value returns validation error
- Bars outside 100-2000 range rejected
- Hyperliquid data unavailable and dYdX v4 fallback also fails — returns source error
- Insufficient candle history for the requested bars/timeframe combination
- Fast period >= slow period may produce degenerate results

## How this service works

Technical analysis, risk analytics and backtests for trading agents in one x402 API: RSI, MACD, EMA 20/50/200, Bollinger Bands, ATR, ADX, stochastic, realized volatility and a descriptive technical bias score for any crypto asset on 15m/1h/4h/1d candles; historical VaR/CVaR, max drawdown, Sharpe/Sortino and ATR-based position sizing; and rule backtests (SMA/EMA cross, RSI reversion, Donchian breakout, MACD cross) with fees, next-open fills, trade list and equity curve. Candles from Hyperliquid with dYdX v4 fallback. Read-only analytics; free preview and remote MCP. Not financial advice. 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.

## Output

Returns a JSON object with backtest period metadata, strategy parameters used, trade count, list of last trades (entry/exit price, return %, timestamps), a sampled equity curve, win rate, profit factor, Sharpe ratio (annualized), max drawdown, total and annualized return, buy-and-hold return, excess return vs buy-and-hold, exposure percentage, current position, fees applied, data source, confidence level, and a disclaimer.

## 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-ad7e2872/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tasignal.agentgate.workers.dev](https://www.zero.xyz/host/tasignal.agentgate.workers.dev/llms.txt)
