{"uid":"cap_oi9p0Ku_Amgxku3TEzhLN","slug":"crypto-backtest-8a293f51","name":"Crypto Backtest","description":"Backtest any crypto strategy on 399 Coinbase coins, bias-free. Breakout, momentum, dip-buy or MA trend rules on Coinbase daily data with fees, slippage, H1/H2 split, luck flag and survivorship-bias-free universe.","url":"https://grok-backtest-api.fly.dev/backtest?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"end":{"anyOf":[{"type":"string"},{"type":"null"}]},"fee":{"type":"number","maximum":0.05,"minimum":0},"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"slippage":{"type":"number","maximum":0.05,"minimum":0},"strategy":{"oneOf":[{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"breakout"},"params":{"type":"object","properties":{"gate":{"enum":["none","btc_ma50","breadth50"],"type":"string"},"atr_mult":{"type":"number","maximum":6,"minimum":0.5},"lookback":{"type":"integer","maximum":60,"minimum":5},"max_stop_pct":{"type":"number","maximum":0.9,"exclusiveMinimum":0},"min_stop_pct":{"type":"number","maximum":0.5,"exclusiveMinimum":0},"max_positions":{"type":"integer","maximum":10,"minimum":1},"risk_per_trade":{"type":"number","maximum":0.25,"exclusiveMinimum":0},"max_position_pct":{"type":"number","maximum":1,"exclusiveMinimum":0}},"additionalProperties":false}},"additionalProperties":false},{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"momentum"},"params":{"type":"object","properties":{"gate":{"enum":["none","btc_ma50","breadth50"],"type":"string"},"top_n":{"type":"integer","maximum":10,"minimum":1},"lookback":{"type":"integer","maximum":60,"minimum":3},"trail_pct":{"anyOf":[{"type":"number","exclusiveMaximum":0.9,"exclusiveMinimum":0},{"type":"null"}]},"rebalance_days":{"type":"integer","maximum":30,"minimum":1}},"additionalProperties":false}},"additionalProperties":false},{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"dip"},"params":{"type":"object","properties":{"days":{"type":"integer","maximum":10,"minimum":1},"drop_pct":{"type":"number","exclusiveMaximum":0.9,"exclusiveMinimum":0.01},"trend_filter":{"enum":["ma50","none"],"type":"string"},"hard_stop_pct":{"type":"number","exclusiveMaximum":0.9,"exclusiveMinimum":0.01},"max_hold_days":{"type":"integer","maximum":60,"minimum":1},"max_positions":{"type":"integer","maximum":10,"minimum":1}},"additionalProperties":false}},"additionalProperties":false},{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"ma_trend"},"params":{"type":"object","properties":{"coins":{"type":"array","items":{"type":"string"},"maxItems":10,"minItems":1},"ma_days":{"type":"integer","maximum":60,"minimum":5}},"additionalProperties":false}},"additionalProperties":false}]},"universe":{"type":"object","properties":{"mode":{"enum":["point_in_time","current_top","fixed"],"type":"string"},"coins":{"anyOf":[{"type":"array","items":{"type":"string"},"maxItems":200},{"type":"null"}]},"top_n":{"type":"integer","maximum":200,"minimum":5},"min_age_days":{"type":"integer","maximum":120,"minimum":0},"min_avg_dollar_volume":{"type":"number","minimum":0}},"additionalProperties":false},"include_trades":{"type":"boolean"},"initial_capital":{"type":"number","maximum":1000000000,"exclusiveMinimum":0}}},"responseSchema":{"type":"json","example":{"win_rate":0.308,"fees_paid":22.08,"luck_flag":true,"return_pct":10.98,"final_value":166.47,"closed_trades":26,"max_drawdown_pct":-23.77}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MadvKvm8WbaQP3miIahzh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs a historical backtest of a crypto trading strategy (breakout, momentum, or dip-buying) on Coinbase daily candles with survivorship-bias-free universe construction, returning PnL metrics and trade statistics.","exampleAgentPrompt":"Run a backtest of a momentum strategy on crypto from January 2022 to December 2023, holding the top 5 tokens, with a 20-day lookback, rebalancing every 7 days, and a 10% trailing stop — use a BTC MA50 market gate and assume 0.1% slippage and 0.1% fees.","exampleUseCases":[{"title":"Momentum strategy historical performance check","prompt":"Backtest a momentum strategy on crypto daily candles from Jan 2021 to Dec 2023, holding the top 3 tokens by 30-day momentum, rebalancing every 5 days, with a BTC MA50 gate and 0.15% slippage."},{"title":"Breakout strategy with ATR-based stops","prompt":"Can you backtest a breakout strategy from March 2022 through March 2024 with a 20-day lookback, ATR multiplier of 2.5, max 5 open positions, 2% risk per trade, and breadth50 market gate? Use 0.1% fees and 0.1% slippage."},{"title":"Dip-buying strategy stress test during bear market","prompt":"Run a dip-buy backtest from November 2021 to December 2022 — buy tokens that drop more than 15% in 3 days, hold up to 30 days or until a 20% hard stop, using a MA50 trend filter. Set slippage to 0.2% and fees to 0.05%."}],"resultDescription":"A JSON object containing total return percentage, final portfolio value, win rate, number of closed trades, maximum drawdown percentage, total fees paid, and a luck flag indicating whether the strategy's performance may be attributable to chance rather than edge.","failureModes":["Invalid strategy type returns a validation error","Date range with insufficient historical data may produce unreliable or empty results","Slippage or fee values outside allowed range (0–0.05) are rejected","Strategy parameters outside allowed bounds (e.g. lookback > 60) fail validation","Payment not settled via x402 results in 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need to historically validate a crypto trading strategy (breakout, momentum, or dip-buying) on Coinbase daily candles with a survivorship-bias-free universe. Prefer it over generic backtesting tools when you need point-in-time universe construction that avoids lookahead bias, and when pay-per-call economics (no subscription) are preferred. Use it before deploying any systematic crypto strategy to quantify expected drawdown, win rate, and return.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:36:56.303Z","isFirstParty":false,"canonicalSlug":"crypto-backtest-8a293f51"}