{"uid":"cap_DNUOLwvHoBg2plVw6GB4z","slug":"hedgehog-edge-perpetual-markets-backtester-afaebfc7","name":"Hedgehog Edge Perpetual Markets Backtester","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-perpetual?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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 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.15","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.15/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5iBX-B3NTYVQqXMVH0zy7","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.15","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Evaluate Ichimoku signal on BTC perps","prompt":"Backtest the TK cross bullish signal on BTC/USDT perpetual futures using a daily timeframe for the past year, with indicator reversal as the exit and 0.055% commission — what's the win rate and Sharpe ratio?"},{"title":"Test trailing stop on ETH perp strategy","prompt":"Run a perpetual futures backtest for ETH/USDT using the EMA 9/21 cross indicator on the 4-hour chart from 2024-01-01 to 2024-12-31, using a trailing stop exit set at 5%, and tell me the total return and max drawdown."},{"title":"Compare fixed take-profit exit on SOL","prompt":"Can you backtest the RSI14 entry signal on SOL/USDT perps on the daily chart for 2024, using a fixed percentage exit with a 15% take profit and 7% stop loss at 0.055% commission — how many trades did it take and what was the final capital?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T18:33:01.308Z","isFirstParty":false,"canonicalSlug":"hedgehog-edge-perpetual-markets-backtester-afaebfc7"}