← Back to the stock backtester · Options backtester guide

How the stock backtester works

Pick a stock and a rule for when to buy (or short) it, and see how that rule would have done, trade by trade, on the stock's daily prices since 1998 - and what the stock did after every signal compared with any other day. Then save it, and follow the ones you like in a portfolio.

Your first backtest in four steps

1. Pick a stockAny US stock or ETF, e.g. SPY, QQQ, AAPL, NVDA.
2. Pick when to tradeAfter a fall, a gap, a new high, a moving-average cross, an RSI level, earnings, an insider buy or a big option trade.
3. Say how to get in and outBuy or short, enter at the next open or the close, hold a number of days, with an optional profit target or stop.
4. Run itSee every trade, how often it made money, the average trade against any day and against SPY, and what owning the stock would have made.

Start a free trial The stock backtester is included with Market Chameleon Premium and Premium Options.

When to trade: the rules

RuleWhen it firesSettings
Every week / Every monthThe first trading day of each week or month. The yardstick: a timing rule is only worth something if it beats buying on a schedule.-
After a fall / After a riseThe stock fell (or rose) at least X% over the last N trading days, close to close.Move, %; over trading days. E.g. 5% in 5 days.
Gap down / Gap up at the openThe stock opened at least X% below (or above) the previous close.Move, %. Enter at the gap day's open to trade the gap itself.
New 52-week high / lowThe close is the highest (or lowest) of the last 52 weeks.-
Moving averages cross up / downThe fast moving average (or the price itself) crosses above (or below) the slow one.Fast and slow averages in days; 50 / 200 is the "golden cross" (up) and "death cross" (down); fast 1 = the price.
RSI drops below / rises above a levelThe 14-day RSI crosses below (or above) the level.RSI level: 30 is usually called "oversold", 70 "overbought".
Around earningsBefore the report (held through it), after it, or only after a big move up or down on the news.Earnings timing; Move, % for the "after a rise / fall" choices.
After an insider buyAn open-market purchase of at least $X by an officer, director or 10% owner is filed on Form 4.Insider buy at least, $; insiders buying within 2 weeks.
After a big call / put buySomeone bought calls (or puts) for at least $X in premium in one trade.Option premium at least, $. Our big-trade records start in November 2024.

Getting in and out

SettingWhat it meansExample
DirectionBuy the stock, or short it (you make money if it falls).Short after a 52-week low to test whether lows keep falling.
Enter atThe next morning's open (the default - you can act on a signal only once it's known), the signal day's close, or the gap day's open (gap rules only)."The next morning's open" after a fall that shows at the close.
Hold, trading daysHow long a trade stays open if nothing else closes it first.5 = about a week, 21 = a month, 63 = three months.
Profit target / Stop lossOptional: close when the price reaches this gain (or loss) during a day - at that price, or at the open if the stock opens past it.Out at +5% or after a month, whichever comes first.
Trailing stopOptional: close when the stock falls this much from its best price since the trade opened (rises, when short).10% lets a winner run but keeps most of a big move.
Every signal its own tradeUnticked (the default): one trade at a time, like one account following the rule. Ticked: each signal opens its own trade, even while another is open.Tick it to judge every signal, not just the ones a single account could take.
Signals this close count onceSignals within this many trading days of the last one count as one, so a run of signals isn't counted five times.20 = at most one trade a month from a run of new highs.
Years back, money a trade, costsHow much history to test (up to 25 years), how much each trade puts in ($10,000 by default) and the trading cost each way (5 basis points by default).-

Reading the results

  • The numbers at the top - how many trades, the share that made money, the average trade (and the median), the total in dollars, what owning the stock the whole time would have made, the average trade against SPY over the same days, the biggest dip from a high, the share of days the rule had money in the market, the profit factor (dollars won divided by dollars lost) and the average days held.
  • What the stock did next - its move 1, 5, 21 and 63 trading days after every signal, next to the same moves from any day and against SPY. This tells you whether the signal itself means anything, before any exit rules.
  • Profit over time - the rule's running total next to simply owning the stock.
  • Every trade - each trade with its signal, dates, prices, result and how it ended (held the full time, profit target, stop or trailing stop).
Owning the stock usually wins in dollars - that's expected. A timing rule has money in the stock only on some days (often 5-20% of them); owning it keeps the money working every day. Judge a rule by its average trade against any day and against SPY, and by the share of days it needs to be in the market.

Save it, and put it into a portfolio

  1. After a run, name it and press Save backtest. Your saved stock backtests are listed on the page - open one to run it again on the latest data.
  2. Pick a portfolio (or make a new one) and press Add to portfolio. From the next trading day, the same rule runs forward - no hindsight.
  3. Portfolios are shared with the options backtester, so one portfolio can hold stock and options strategies side by side.

Examples from our data

Buying SPY after a 5% fall in 5 days, held a month

20 years (Nov 2006 - Nov 2026): 33 trades, 67% made money, +1.2% average a trade (+0.6% median), $3,977 in all at $10,000 a trade. The rule was in the market only 14% of days - owning SPY the whole time made $68,076, which is why the average trade is the number to compare.

QQQ's golden cross (50-day average above the 200-day), held 3 months

25 years: 15 trades, 80% made money, +6.5% average a trade, 1.3 points a trade ahead of SPY over the same days, profit factor 5.05. Few signals, so each one weighs a lot.

AAPL the day before earnings, out the day after

15 years: 61 reports, 51% made money, +0.3% average a trade - close to a coin flip. The report-day move goes either way, so for AAPL, holding the stock through earnings hasn't been an edge on its own.

SPY at a new 52-week high, held 3 months with a 10% trailing stop

25 years, signals within 20 days counted once: 52 trades, 69% made money, +2.3% average a trade, in the market 49% of days. In this test, buying new highs made money more often than not - a new high wasn't a sign of a top.

IWM when the RSI drops below 30, out at +5% or after a month

20 years: 32 trades, 78% made money, +1.5% average a trade but a +4.9% median. When the median is well above the average, a few big losses are pulling the average down - check the trade list before trusting the win rate.

These are what the rules did on our historical data, run on November 10, 2026; they are hypothetical, not predictions or investment advice - see the disclaimer below.

Good to know

  • One stock at a time. Daily prices go back to 1998, or to the stock's first trading day if later.
  • Returns are worked out on split- and dividend-adjusted prices; trades are shown at the prices the stock actually traded at.
  • Earnings dates come from our earnings calendar; insider buys come from Form 4 filings; big option trades start in November 2024.
  • A signal is only known once its day's data is in, which is why the default entry is the next morning's open.
  • Past results don't predict future ones - which is why a portfolio follows the same rule forward.

Important: hypothetical results, not investment advice. The backtests and portfolios on these pages are hypothetical. They show what a set of rules would have done on historical and end-of-day option prices; no trades were placed and no money was invested. Portfolios apply the same rules going forward from the day they were added, using end-of-day prices; they are not real accounts and do not reflect actual trades.

Hypothetical or simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Since the trades have not been executed, the results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. Results reflect the fill and commission assumptions stated with each test and may not reflect taxes, margin requirements, early assignment, dividends or other costs.

Stock and option trading involves risk that may not be suitable for all investors. Options involve risk and are not suitable for all investors; before trading options, read Characteristics and Risks of Standardized Options.

This information is provided for informational and educational purposes only and should not be construed as investment advice, or as a recommendation to buy or sell any security or to follow any strategy or portfolio. Neither Market Chameleon nor any other party makes warranties regarding results from its usage. Past performance, actual or hypothetical, does not guarantee future results. Please consult a financial advisor before executing any trades.

Market Data Delayed 15 Minutes