{"uid":"cap_-vhQpOvVc0FHm4h18hIAb","slug":"x402stock-backtest-ba6f9d06","name":"x402stock Backtest","description":"Backtests a simple rule on a US stock and returns a finished report PNG. Runs an SMA crossover (?strategy=sma_cross&fast=50&slow=200) or RSI mean-reversion (?strategy=rsi_reversion&period=14&lower=30&upper=70) over daily history (?years=, max 5), no lookahead, rendered as an equity curve vs buy & hold. Returns full stats plus a hosted `artifact.png_url`. From x402stock","url":"https://agents.x402stock.xyz/api/v1/backtest/:ticker","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"pathParams":{"type":"object","ticker":{"type":"string"}},"queryParams":{"type":"object","properties":{"fast":{"type":"integer","default":50,"maximum":200,"exclusiveMinimum":0},"slow":{"type":"integer","default":200,"maximum":400,"exclusiveMinimum":0},"lower":{"type":"number","default":30,"maximum":99,"minimum":1},"upper":{"type":"number","default":70,"maximum":99,"minimum":1},"years":{"type":"number","default":3,"maximum":5,"exclusiveMinimum":0},"period":{"type":"integer","default":14,"maximum":100,"exclusiveMinimum":0},"capital":{"type":"number","default":10000,"maximum":1000000000,"exclusiveMinimum":0},"strategy":{"enum":["sma_cross","rsi_reversion"],"type":"string","default":"sma_cross"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.5","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.5/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.5","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.5","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_SZ_UtsPn6Ms4qgjYrG5RN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.5","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Backtests an SMA crossover or RSI mean-reversion strategy on a US stock ticker and returns a PNG equity-curve report with full performance statistics","exampleAgentPrompt":"Run an SMA crossover backtest on NVDA using a 50-day fast and 200-day slow moving average over the last 3 years starting with $10,000 capital, and show me the equity curve PNG comparing it to buy and hold.","exampleUseCases":[{"title":"Golden cross strategy evaluation","prompt":"Backtest a 50/200 SMA crossover on AAPL over the last 5 years with $50,000 starting capital and send me the equity curve image comparing it to buy and hold."},{"title":"RSI mean-reversion on ETF","prompt":"Run an RSI mean-reversion backtest on SPY using a 14-day period with lower threshold 30 and upper 70, over 3 years starting with $10,000 — I want to see the stats and the chart."},{"title":"Strategy comparison for volatile stock","prompt":"Can you backtest an SMA crossover strategy on TSLA with a 20-day fast and 100-day slow moving average over the last 2 years and show me how it performed versus just holding?"}],"resultDescription":"Returns a hosted PNG image URL (artifact.png_url) showing the strategy equity curve plotted against a buy-and-hold baseline, plus full backtest statistics including returns, drawdown, and other performance metrics computed over the requested historical window with no lookahead bias.","failureModes":["Invalid or delisted ticker returns an error with no data","fast SMA period >= slow SMA period may produce degenerate results","years parameter exceeding 5 is rejected","RSI lower >= upper threshold may cause validation error","Insufficient historical data for requested period","Payment of 0.5 USDC not confirmed results in 402 response"],"whenToPreferThis":"Choose this endpoint when you need a quick, visual backtest of a standard technical strategy (SMA crossover or RSI mean-reversion) on a US equity with a rendered PNG report and hosted image URL. It is ideal for AI agents that need to present a chart artifact to users. Prefer alternatives if you need custom strategy logic, intraday data, options backtesting, or multi-asset portfolio simulation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:48:25.749Z","isFirstParty":false}