{"uid":"cap_Zq6XEbV_Drc30iNRzDczi","slug":"agents-x402stock-xyz-x402stock-stock-backtest-with-png-report-24a0fe0b","name":"x402stock Stock Backtest with PNG Report","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","required":["ticker"],"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},"ticker":{"type":"string","description":"US-listed ticker symbol (uppercase), e.g. AAPL."},"capital":{"type":"number","default":10000,"maximum":1000000000,"exclusiveMinimum":0},"strategy":{"enum":["sma_cross","rsi_reversion"],"type":"string","default":"sma_cross"}}},"responseSchema":{"type":"object","required":["ticker","source","as_of","artifact","strategy","data","disclaimer"],"properties":{"data":{"type":"object","required":["bars","start_date","end_date","initial_capital","strategy","buy_hold","trades"],"properties":{"bars":{"type":"number"},"trades":{"type":"object","required":["count","win_rate_percent","avg_return_percent","best_percent","worst_percent","list"],"properties":{"list":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}]}}},"count":{"type":"number"},"best_percent":{"type":"number"},"worst_percent":{"type":"number"},"win_rate_percent":{"type":"number"},"avg_return_percent":{"type":"number"}},"additionalProperties":false},"buy_hold":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}]},"strategy":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}]},"initial_capital":{"type":"number"}},"additionalProperties":false},"as_of":{"type":"string"},"source":{"type":"string","const":"x402stock"},"ticker":{"type":"string"},"artifact":{"type":"object","required":["id","url","format","expires_at"],"properties":{"id":{"type":"string"},"url":{"type":"string"},"format":{"type":"string","const":"png"},"expires_at":{"type":"string"}},"additionalProperties":false},"strategy":{"type":"object","required":["kind","label","params"],"properties":{"kind":{"type":"string"},"label":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"additionalProperties":false},"disclaimer":{"type":"string"}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.5","displayCostAsset":"USD","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":"mpp","network":"tempo","amountUsd":"0.5","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.5","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5-cd2wCDfQ4RO5pt5G8Eh","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.5","costPer":"request","priority":0,"asset":"usd","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agents.x402stock.xyz","brandSlug":"agents-x402stock-xyz-mpp","brandBaseUrl":"https://agents.x402stock.xyz","brandDocsUrl":null,"whatItDoes":"Runs an SMA crossover or RSI mean-reversion backtest on a US stock ticker over up to 5 years of daily history and returns performance statistics plus a hosted equity-curve PNG report.","exampleAgentPrompt":"Run a backtest on AAPL using the SMA crossover strategy with a 50-day fast and 200-day slow moving average over the last 3 years, starting with $10,000 capital, and give me the performance stats and equity curve chart.","exampleUseCases":[{"title":"Golden cross strategy evaluation","prompt":"Backtest the classic 50/200-day SMA golden cross strategy on SPY over the last 5 years with $50,000 starting capital and show me how it performed versus just buying and holding."},{"title":"RSI mean-reversion on tech stock","prompt":"Can you run an RSI mean-reversion backtest on NVDA using a 14-day period, buying below 30 and selling above 70, over the past 3 years? I want to see the win rate and equity curve."},{"title":"Strategy parameter tuning comparison","prompt":"Test the SMA crossover on TSLA with a 20-day fast and 100-day slow moving average over 2 years starting with $25,000 — I want to see the trade list and how it stacked up against buy and hold."}],"resultDescription":"Returns a JSON object containing: a hosted PNG artifact URL (equity curve vs buy-and-hold, expires after a set time), strategy metadata (kind, label, parameters), full performance stats (total return, Sharpe-equivalent metrics, max drawdown as available), trade-level detail (count, win rate, average/best/worst return per trade, full trade list), buy-and-hold comparison stats, the date range and bar count used, and a disclaimer. The PNG is accessible via the artifact.url field.","failureModes":["Unknown or delisted ticker returns a 404 or error response","Strategy parameter conflicts (fast >= slow for SMA) may cause a validation error","Insufficient historical data for the requested years returns partial or error response","years parameter exceeding 5 is rejected","Invalid strategy enum value returns a 400 bad request","Payment not processed via x402 returns a 402 Payment Required","Artifact URL expires after the stated expiry time and becomes inaccessible"],"whenToPreferThis":"Choose this endpoint when you need a quick, no-setup quantitative backtest of a classic technical strategy (SMA crossover or RSI mean-reversion) on a US-listed stock or ETF, and want both machine-readable statistics and a shareable visual equity curve PNG in a single call. It is ideal for agents that need to evaluate strategy viability, compare against buy-and-hold, or generate a report artifact without running their own backtesting infrastructure. Prefer alternatives if you need custom strategies beyond SMA cross or RSI reversion, intraday data, or multi-asset portfolio-level backtests.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-10T06:46:31.928Z","isFirstParty":false}