Strategy backtesting

Backtest a stock strategy over up to 20 years vs the S&P 500

Stress-test a simple rule on up to 20 years of US large-cap price history — CAGR, Sharpe, drawdown and win rate, benchmarked against SPY, with signals that never peek at the future.

US coverage included in your free 14-day trial · no credit card required

StoqPulse's backtester runs a walk-forward simulation over a selectable window of up to 20 years on US large caps: pick a preset rule, set a rebalance schedule, and see how an equal-weight model portfolio would have tracked against the S&P 500. Every price signal uses only data available on each rebalance date, so you measure a rule's edge instead of hindsight. US coverage anchors your free 14-day trial across StoqPulse; the backtester itself is a Pro feature — we say so plainly below.

Four preset strategies, one click

Choose from four ready rules: Quality + Momentum (strong 6-month trend with price above the 200-day average), Deep Value (biggest drawdowns from the 52-week high — contrarian, higher volatility), Low Volatility (the calmest names, often a better Sharpe), and F-Score ≥ 7 (high-quality balance sheets, then ranked by momentum). The simulation ranks a 25-name US large-cap universe at each rebalance and holds the top eight, equal-weight. No formula-building required — pick a preset, pick a cadence, and run.

Walk-forward over up to 20 years, no lookahead

The engine pulls the daily Yahoo price history for your chosen window — 5, 10, 15, or 20 years — for 25 large caps plus SPY, uses the first year (252 trading days) as a warm-up for indicators, then walks forward bar by bar. At each rebalance date, holdings are scored using only prices up to that day — momentum, 200-day trend and volatility are all computed in-sample, never with future data. That discipline is the whole point: it tells you whether a rule would have worked in real time, not whether it fits the past in hindsight.

CAGR, Sharpe, drawdown and win rate vs SPY

Each run reports four headline metrics: CAGR (smoothed annual return), Sharpe (return per unit of volatility, annualised), max drawdown (worst peak-to-trough drop), and win rate (share of rebalance periods that ended positive). Alongside, you get alpha in CAGR terms versus the S&P 500, total return for both strategy and SPY, and the exact test window. The benchmark is buy-and-hold SPY, so you always see the rule against the obvious passive alternative.

Equity curve, drawdown and monthly returns

Results render as an indexed equity curve — strategy versus SPY, both starting at 100 — plus a peak-to-trough drawdown chart and a last-12-months returns grid. A final table shows the model portfolio at the last rebalance: the eight equal-weight holdings with names and weights. Rebalancing carries a small 10bps friction per turn to stay honest about real-world costs. Everything is hypothetical and historical, labelled as such, and meant to stress-test rules — not forecast the future.

Weekly, monthly or quarterly rebalancing

Rebalance cadence changes a strategy's behaviour, so you can flip between weekly, monthly and quarterly and re-run instantly. Faster rebalancing reacts quicker but trades more (and pays more friction); slower cadence is calmer and cheaper. Comparing the same rule across cadences is one of the quickest ways to see whether an edge is real or just an artefact of turnover. Each run pulls live prices, so a typical backtest completes in about 15 to 30 seconds.

An honest limitation we won't hide

The F-Score ≥ 7 preset filters on today's Piotroski F-Score, not the score as it stood on each historical rebalance date — true point-in-time fundamentals would require a data warehouse we don't yet run. So that one strategy carries mild lookahead on the quality filter (its price signals are still walk-forward). The other three presets use only price data and have no such caveat. We flag this in the product itself, because a backtest you can't trust is worse than none.

A Pro feature — and what your free trial gives you

Backtesting is gated to Pro and above via the accessBacktest entitlement; the free 14-day trial sees an upgrade wall rather than a run button. That said, StoqPulse's free US trial still gives you the building blocks behind these strategies — the composite multi-factor score, Piotroski F-Score and screener that define the same rules you'd backtest. Check live pricing for current Pro terms; we never quote our own prices here because they're configured dynamically, not baked into this page.

Frequently asked questions

It runs an equal-weight model portfolio of the top eight US large caps that fit your chosen rule, rebalanced weekly, monthly or quarterly over a window you choose (5, 10, 15, or 20 years) of daily price history, and compares it to buy-and-hold SPY. A small 10bps friction is applied per rebalance. Results are hypothetical and historical, meant to stress-test rules rather than predict returns.

For price signals, yes. At each rebalance the engine scores stocks using only data up to that bar — momentum, the 200-day trend and volatility are all computed in-sample. The one exception is the F-Score ≥ 7 preset, whose quality filter uses today's F-Score rather than point-in-time fundamentals. We flag that limitation directly in the product.

Every run shows CAGR, Sharpe ratio, max drawdown and win rate, plus total return and alpha in CAGR terms. The benchmark is buy-and-hold S&P 500 via SPY, indexed to 100 at the start so you can read the equity curves side by side. You also get a drawdown chart, a 12-month returns grid and the final model-portfolio holdings.

Backtesting is a Pro-and-above feature, gated by the accessBacktest entitlement; free-trial users see an upgrade prompt instead of running simulations. The underlying rules — composite score, Piotroski F-Score and the screener — are available during StoqPulse's free 14-day US trial, so you can build and inspect strategies before upgrading. See live pricing for current Pro terms.

Not yet. The current backtester runs on a fixed universe of 25 liquid US large caps plus SPY as the benchmark, which keeps each run to a reasonable number of live price fetches (about 15 to 30 seconds). You choose the strategy preset and rebalance cadence; the universe and equal-weight, eight-name construction are fixed for now.

Usually 15 to 30 seconds (a little longer for a 20-year window). Each run fetches the live daily prices for your chosen window (5, 10, 15, or 20 years) for 25 large caps plus SPY, then simulates the walk-forward rebalances and computes metrics. Because it pulls fresh history each time, results reflect current data rather than a stale cached snapshot, with the F-Score quality caveat noted above.

Start free for 14 days — US coverage included

Build the discipline into your process. No credit card required.