# Hedgehog Edge Perpetual Markets Backtester

> Hedgehog Edge Perpetual Markets Backtester is a paid API for AI agents from hedgehogedge.com, paid per call via x402, $0.15/call, status unknown (last checked 2026-10-11).

Runs a backtest of a technical indicator-based trading strategy on perpetual futures (perp) markets for a given crypto pair and timeframe, returning trade-by-trade results and summary performance metrics.

## Facts

- Endpoint: POST https://hedgehogedge.com/api/x402/backtest/run-perpetual?utm_source=zero.xyz
- Price: $0.15/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hedgehog-edge-perpetual-markets-backtester-afaebfc7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DNUOLwvHoBg2plVw6GB4z

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 hedgehog-edge-perpetual-markets-backtester-afaebfc7 -d '<json body>'
```

Example prompt: Run a backtest on BTC/USDT perpetual futures using the golden cross indicator on the daily timeframe from 2023-01-01 to 2024-01-01, with an indicator_reversal exit strategy and 0.055% commission — show me the win rate, total return, and max drawdown.

## When to prefer this

Choose this endpoint when you need to evaluate the historical performance of a specific technical indicator-based entry signal on perpetual futures markets (not spot or alt/BTC pairs). It is especially valuable when you want detailed trade-by-trade results alongside aggregate statistics like Sharpe ratio and max drawdown, and when you want to test different exit strategies (trailing stop, ATR, fixed percentage, moving average, or indicator reversal) against the same entry signal.

## Known failure modes

- Invalid or unsupported trading pair symbol returns an error
- Unsupported indicator enum value returns a validation error
- Date range with insufficient historical data may return empty trades array
- Invalid exit strategy or mismatched exitParams schema returns a parameter error
- Commission value out of expected range may cause a validation error
- Payment not provided or insufficient funds results in 402 response

## How this service works

Hedgehog Edge is a Crypto trading analytics platform for backtesting indicators, comparing strategies, analyzing spot, alt/BTC & perp markets, and getting real-time signal alerts.

## Output

Returns a JSON object with two parts: a 'trades' array listing each individual trade with entry/exit price, entry/exit time, profit, and exit reason; and a 'summary' object containing overall stats including total trades, win rate, total profit, total return percentage, final capital, max drawdown, and Sharpe ratio.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "symbol": {
   "type": "string",
   "description": "Trading pair, e.g. \"BTC/USDT\" or \"BTC/USD\" — USD/USDT variants resolve to the same dataset."
  },
  "endDate": {
   "type": "string",
   "description": "YYYY-MM-DD. Optional — defaults to a 1-year window ending yesterday."
  },
  "indicator": {
   "enum": [
    "tk_cross_bullish",
    "kumo_breakout_bullish",
    "senkou_span_cross_bullish",
    "kijun_cross_bullish",
    "tk_cross_above_cloud",
    "edge_to_edge_bull",
    "tk_cross_bullish_alternate",
    "kumo_breakout_bullish_alternate",
    "senkou_span_cross_bullish_alternate",
    "kijun_cross_bullish_alternate",
    "tk_cross_above_cloud_alternate",
    "edge_to_edge_bull_alternate",
    "edge_to_edge",
    "tk_cross_cloud",
    "ha_daily_green",
    "golden_cross",
    "ema_cross_9_21",
    "ema_cross_12_26",
    "price_above_sma9",
    "price_above_sma20",
    "price_above_sma50",
    "price_above_sma100",
    "price_above_sma200",
    "price_above_ema9",
    "price_above_ema12",
    "price_above_ema26",
    "price_above_ema20",
    "price_above_ema50",
    "price_above_ema100",
    "price_above_ema200",
    "rsi14",
    "rsi9",
    "adx_strong_trend",
    "adx_weak_trend",
    "adx_bullish",
    "adx_bearish",
    "macd_cross",
    "bb_squeeze"
   ],
   "type": "string",
   "description": "The single entry/exit signal indicator for the backtest."
  },
  "startDate": {
   "type": "string",
   "description": "YYYY-MM-DD. Optional — defaults to a 1-year window ending yesterday."
  },
  "timeframe": {
   "enum": [
    "D",
    "W",
    "3D",
    "1h",
    "4h",
    "12h"
   ],
   "type": "string",
   "description": "Candle timeframe. Defaults to D (daily)."
  },
  "commission": {
   "type": "number",
   "description": "Per-trade commission in % (e.g. 0.055)."
  },
  "exitParams": {
   "type": "object",
   "description": "Parameters for the chosen exitStrategy: trailing_stop → {percentage: 0.1-50}; atr_trailing_stop → {multiplier: 0.1-10}; fixed_percentage → {takeProfit: >0, stopLoss?: >0}; moving_average → {type: 'sma'|'ema', period: 1-200}; indicator_reversal → {}."
  },
  "exitStrategy": {
   "enum": [
    "indicator_reversal",
    "trailing_stop",
    "fixed_percentage",
    "atr_trailing_stop",
    "moving_average"
   ],
   "type": "string",
   "description": "Exit logic. Defaults to indicator_reversal. Restricted strategies (trailing_stop, fixed_percentage, atr_trailing_stop) are limited to a 2-year 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "trades": [
   {
    "profit": 12.04,
    "exitTime": "2024-09-12T00:00:00.000Z",
    "entryTime": "2024-08-05T00:00:00.000Z",
    "exitPrice": 60500,
    "entryPrice": 54000,
    "exitReason": "indicator_reversal"
   }
  ],
  "summary": {
   "winRate": 58.3,
   "maxDrawdown": -8.2,
   "sharpeRatio": 1.4,
   "totalProfit": 125.5,
   "totalReturn": 12.55,
   "totalTrades": 24,
   "finalCapital": 1125.5
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hedgehog-edge-perpetual-markets-backtester-afaebfc7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hedgehogedge.com](https://www.zero.xyz/host/hedgehogedge.com/llms.txt)
