{"uid":"cap_Q5aBH71UyTSr9rHvW32Wf","slug":"hedgehog-edge-inverse-backtest-runner-bc40ab5d","name":"Hedgehog Edge Inverse Backtest Runner","description":"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.","url":"https://hedgehogedge.com/api/x402/backtest/run-inverse?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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, fixed_percentage, atr_trailing_stop) are limited to a 2-year date range."},"initialCapital":{"type":"number","description":"Starting capital (USD for run-perpetual; coin units for run-inverse)."},"tradingDirection":{"enum":["LONG_ONLY","SHORT_ONLY"],"type":"string","description":"Position direction. Defaults to LONG_ONLY."},"allocationPercentage":{"type":"number","description":"Percentage of capital allocated per trade (1-100)."}}},"responseSchema":{"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}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.2","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.2/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.2","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.2","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dnJE5y31BFbSeI0N5Le2f","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.2","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Short BTC Ichimoku strategy evaluation","prompt":"Backtest shorting Bitcoin using the tk_cross_bullish indicator on a 4-hour timeframe from 2023-06-01 to 2024-06-01, using indicator_reversal as the exit strategy and 0.1% commission — give me the win rate, max drawdown, and Sharpe ratio."},{"title":"RSI-based inverse ETH strategy","prompt":"Can you run an inverse backtest on ETH/USD with RSI14 as the signal, daily candles, over the last year, using a fixed_percentage exit with 15% take profit and 7% stop loss and 0.055% commission?"},{"title":"ATR trailing stop short simulation","prompt":"Simulate a short strategy on BTC/USD using the macd_cross indicator on the weekly timeframe from 2022-01-01 to 2023-12-31, with an ATR trailing stop at 2x multiplier and 0.1% commission — I want to see the full trade list and the final capital."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T00:34:20.537Z","isFirstParty":false,"canonicalSlug":"hedgehog-edge-inverse-backtest-runner-bc40ab5d"}