# Hedgehog Edge Inverse Backtest Runner

> Hedgehog Edge Inverse Backtest Runner is a paid API for AI agents from hedgehogedge.com, paid per call via x402, $0.2/call, status unknown (last checked 2026-10-12).

Runs an inverse (short/contrarian) backtest on BTC or ETH using a chosen technical indicator, exit strategy, and date range, returning trade-by-trade results and summary performance metrics.

## Facts

- Endpoint: POST https://hedgehogedge.com/api/x402/backtest/run-inverse?utm_source=zero.xyz
- Price: $0.2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hedgehog-edge-inverse-backtest-runner-bc40ab5d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q5aBH71UyTSr9rHvW32Wf

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-inverse-backtest-runner-bc40ab5d -d '<json body>'
```

Example prompt: Run an inverse backtest on BTC/USDT using the golden_cross indicator on a daily timeframe from 2023-01-01 to 2024-01-01, with a trailing stop exit at 10% and 0.055% commission per trade.

## When to prefer this

Choose this endpoint when you specifically want to simulate an inverse (short/contrarian) strategy — i.e., entering short when a bullish signal fires and exiting on reversal or a stop condition. Use it over the standard backtest endpoint when testing bearish or contrarian hypotheses on BTC or ETH.

## Known failure modes

- Unsupported symbol (only BTC/USD, ETH/USD, BTC/USDT, ETH/USDT allowed) returns validation error
- Invalid indicator name not in enum returns 400
- Date range outside available historical data returns error or empty trades
- Invalid exitParams for chosen exitStrategy (e.g. missing percentage for trailing_stop) returns 422
- Payment not included or insufficient results in 402 Payment Required

## 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 a 'trades' array (each trade has entryTime, exitTime, entryPrice, exitPrice, profit, exitReason) and a 'summary' object with winRate, maxDrawdown, sharpeRatio, totalProfit, totalReturn, totalTrades, and finalCapital.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "symbol": {
   "enum": [
    "BTC/USD",
    "ETH/USD",
    "BTC/USDT",
    "ETH/USDT"
   ],
   "type": "string",
   "description": "Only BTC and ETH pairs are supported; USDT variants are normalized to USD."
  },
  "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, fi
… (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-inverse-backtest-runner-bc40ab5d/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)
