See how a trading robot would have done, before you trust it with anything.
Pick a robot, run it on real prices from 2001 to today, and compare it with simply buying and holding. Everything uses pretend money.
What the numbers mean
- Money at the end
- What $10,000 would have grown into.
- Growth per year
- The steady yearly rate that gets you there.
- Worst drop
- The biggest fall from a high point along the way: how scary the ride got.
- Just holding
- What you'd get by buying on day one and never selling. This is the number to beat.
The honest bottom line
We trained robots on 26 years of data and tested them on years they never saw. None of them reliably earned more than simply holding an S&P 500 index fund. The best ones had smaller crashes. Treat this as a place to learn, not a money machine, and not financial advice. Read how the robots were tested.
Money and costs
Tax is estimated each year on sales, with losses offsetting gains. Just holding is taxed once, as if sold at the end. It isn't tax advice: real rates depend on your income and state.
Saved setups
A setup is a robot with its exact settings and years. Tick up to five to compare them side by side. Everything is kept in this browser only.
What $10,000 would have grown to
My robots
Stock robots you built or changed in Build your own, and portfolios you saved.
Beat the robot
You get a hidden stretch of real market history. Each day, decide whether to be invested or in cash. Your orders fill at the next day's price, just like the robots'. You start with $10,000 in cash. The dates and the name stay secret until the end, and prices are scaled to start at 100.
Day 0
Keys: B to buy, S to sell, → for the next day, space to play or pause.
Test a robot on days that haven't happened yet
Past results can fool you, so the real test is the future. Three ways, from easiest to most real:
Stop everything
One button for when you want it all to stop: it stops Live watch, and (if Alpaca is connected) cancels every open order and sells everything in your Alpaca practice account. Then it shows the one change that pauses the daily bot.
1. Forward tests
Press Lock in forward test on any robot or portfolio. Its settings are frozen, and it's scored only on trading days after that. The scores update every weeknight.
2. Watch live
Market status unknownNeeds a free price key from Finnhub or Alpaca. Add one under Connect accounts below. The market is open 9:30am–4pm New York time, weekdays.
Where prices and orders go
The robot checks its rules on "today so far", as if the latest price were the close. If they're met, it trades at the live price, at most one buy and one sell per stock per day. It only runs while this tab is open.
Activity
3. Automatic daily bot
Checking…A scheduled job on GitHub runs at about 11am New York time every trading day and places orders on your Alpaca practice account. It decides using yesterday's closing prices, just like the tests. Portfolio bots rebalance on the first trading day of each month.
Set it up (one time)
- Store your Alpaca keys in GitHub's locked storage. Open the repository's secrets page, press New repository secret and add two:
ALPACA_KEY_ID(your Key ID) andALPACA_SECRET_KEY(your secret key). Nobody else can read these. - Choose what the bot trades. Tick forward tests below, give each a budget, then press Make bot settings.
- Paste the settings into GitHub. Press Copy, open live/bot.json on GitHub, replace everything with what you copied, and press Commit changes.
- Done. To try it straight away during market hours, open the bot's page on GitHub and press Run workflow.
Alerts on your phone
OffGet a notification whenever a robot trades. It uses ntfy, a free notification app with no sign-up.
- Install the ntfy app (App Store or Google Play), or open ntfy.sh/app in a browser.
- Press Make a private channel name below. Anyone who knows the name can read the alerts, so keep it to yourself.
- In the app, press + and subscribe to that exact name, then press Send a test.
- For the daily bot: add it as a GitHub secret named
NTFY_TOPICon the secrets page.
Connect accounts
Keys stay in this browser and are sent only to the service they belong to. They're never put on the public site.
Finnhub: live pricesNo key yet
A free Finnhub key gives live US stock prices for Watch live. After signing up, it's on your Finnhub dashboard.
Alpaca: practice trading accountNot connected
Needed to send orders to a practice account and for the daily bot. It can also supply live prices.
How to get a free Alpaca practice key (about 3 minutes)
- Sign up at app.alpaca.markets/signup. A practice-only account needs just an email address.
- In the dashboard, make sure the switch at the top says Paper (practice), not Live.
- On the Paper home page, find API Keys and press Generate New Keys.
- Copy the Key ID and the Secret Key into the boxes below. The secret is shown only once.
This site only ever talks to Alpaca's paper (practice) address, so it can't touch real money.
Your Alpaca practice account
Connect Alpaca above to see your practice account's money, positions and recent orders.
Help: how the Trading Lab works
The robot
A strategy is a set of buy rules and sell rules. Every trading day, after the market closes, the robot checks its rules against that day's prices. If the buy rules are met and it holds nothing, it buys at the next morning's opening price. If the sell rules are met while it holds the stock, it sells the next morning. Waiting until the next open matters: it means the robot never acts on a price it couldn't have known yet.
It trades one stock at a time, only buys (no betting on prices falling), and holds cash when it's out of the market. Cash earns nothing, to keep things simple.
Safety settings
- Stop-loss: sell if the price falls a set % below what you paid. It triggers during the day, the moment the price touches the level.
- Take-profit: sell once the price is a set % above what you paid.
- Trailing stop: sell if the price falls a set % from its highest point since you bought. It "follows" the price up.
- Time limit: sell after a set number of trading days, no matter what.
- Money per trade: what share of your money goes into each purchase.
Costs
Every buy and every sell pays a fee (commission) and slippage, meaning your order fills a little worse than the quoted price. Leaving these at zero makes strategies that trade a lot look far better than they would be.
The scores
- Yearly growth (CAGR): the steady yearly rate that would turn your starting money into the final amount.
- Worst drop (maximum drawdown): the biggest fall from a high point to a low point along the way. It's how much pain you'd have had to sit through.
- Sharpe ratio: growth divided by how bumpy the ride was. Above 1 is very good for a single stock, and the S&P 500 alone is usually around 0.5.
- Return ÷ drop: yearly growth divided by the worst drop.
- Buy & hold: what you'd get by simply buying on day one and never selling. This is the number to beat.
Why the "hidden exam" matters
If you try thousands of settings, some will look amazing on the past purely by luck. That's like acing a test because you saw the answer key. The fix is to split the years. The tuner may only look at the older part. The winner is then tested on the recent part it never saw. If it does about as well there, it probably found something real. If it falls apart, it memorized noise.
Signs of a trustworthy result: the exam score is close to the training score; many of the top 10 settings also pass the exam; and on the heatmap the best spot sits in a broad bright area, not a single lucky square.
The researched bot: Crash shield
This bot came from a research run on the lab's own data, using the same engine as every other strategy here, including fees and slippage. The aim was a bot that earns about as much as simply holding, with smaller crashes, and keeps doing that on years it never saw.
How it was made. The years were split into three parts:
- 2000–2014: designing and tuning.
- 2015–2020: checking.
- 2021–2026: a final exam, kept locked until the end and opened once.
To avoid fitting one lucky stock, every design was tested on 10 funds: SPY, QQQ, DIA, IWM, VTI, XLE, XLF, XLK, TLT and GLD. A design only counted if it beat holding in both the design and check years. From the survivors, the settings were taken from a broad stable area rather than the single best score.
What it does. It stays invested almost all the time. It sells only when both of these are true:
- the price is more than 6% below its 200-day average;
- the price fell more than 4% over the last 15 trading days.
It buys back as soon as the price is above its 200-day average again, or the last 15 days are positive. Every number is a dial, so you can tune it yourself in Auto-tune.
| Years median of 10 funds | Growth per year | Worst drop | ||
|---|---|---|---|---|
| Shield | Holding | Shield | Holding | |
| 2000–2014 · design | 7.3% | 7.1% | 37% | 56% |
| 2015–2020 · check | 11.8% | 11.1% | 24% | 34% |
| 2021–2026 · final exam | 12.2% | 14.3% | 29% | 26% |
| 2000–2026 · everything | 8.6% | 8.9% | 39% | 57% |
The honest verdict. Over 26 years it earned about the same as holding and cut the worst crash by about a third. On the S&P 500 fund, $10,000 became about $85,600 against $92,500 for holding, with a worst drop of 34% instead of 55%. It did not pass the final exam: in 2021–2026 it trailed holding. Think of it as insurance.
- Where it paid off: slow crashes, like 2002 (−13% vs −22%) and 2008 (−17% vs −37%).
- Where it cost you: sudden drops that bounced straight back, like 2011 (−22% vs +2%) and 2025 (+4% vs +18%).
What else was tried.
- Classic trend following and dip-buying looked excellent on 2000–2014: about 9–10% a year with half the crash. Both collapsed on the check years, at about 3.5% a year against 11.1%. That is the hidden exam doing its job.
- Stop-losses and trailing stops made every design worse. They cut good positions short and the bot bought straight back in.
- Nothing tested here reliably beat simply holding an index fund on return in every era. The most a rule offered was similar long-run growth with smaller crashes.
The research scripts are in the research folder of the repository, if you want to check or extend the work.
The portfolio research: stocks, bonds, gold and more
The second round tested robots that hold several funds at once. The funds were US stocks, international stocks, government and corporate bonds, gold, silver, commodities, real estate and the stock-market sectors. The method was the same as for the Crash shield:
- Sept 2003–2014: designing. This is when the bond funds first had a year of history.
- 2015–2020: checking.
- 2021–2026: a final exam, opened once.
The bar was simply holding the S&P 500, with a classic 60/40 mix for reference. Three kinds of portfolio were tried:
- Fixed mixes hold the same shares every month.
- Trend-protected mixes step out of any fund whose price falls below its long-term average.
- Momentum rotation holds whatever has risen most recently.
| Years | Growth per year · worst drop | |||
|---|---|---|---|---|
| S&P 500 | Balanced | Steady | Momentum | |
| 2003–2014 · design | 8.5% · 55% | 9.3% · 25% | 7.4% · 14% | 11.6% · 21% |
| 2015–2020 · check | 12.8% · 34% | 10.3% · 16% | 7.2% · 9% | 8.3% · 15% |
| 2021–2026 · final exam | 15.3% · 24% | 6.9% · 25% | 4.8% · 19% | 11.7% · 22% |
| 2003–2026 · everything | 11.1% · 55% | 8.9% · 25% | 6.7% · 19% | 10.8% · 22% |
Balanced is 50% S&P 500, 35% long-term Treasury bonds and 15% gold. Steady is 30% S&P 500, 60% medium-term Treasury bonds and 10% gold. Momentum holds the top 3 of US stocks, international stocks, long-term bonds and gold. All are rebalanced monthly, with fees and slippage included.
What was learned.
- The simplest mixes of stocks, bonds and gold were the most dependable on the design and check years. Every fixed mix tested beat the S&P 500 on smoothness in both periods. In 2008 Balanced lost 10% while the S&P 500 lost 37%.
- Momentum rotation mostly failed the check. Only 4 of 312 versions beat the S&P 500 in both the design and check years. It looked brilliant on the years it was designed on, then faded.
- Every portfolio failed the final exam. 2021–2026 was a strong run for US stocks, and in 2022 bonds crashed along with them, which is exactly when a mix is supposed to protect you. Balanced lost 20% that year. Momentum, which was not the research pick, came closest.
The takeaway is the same as for single stocks. Spreading money across stocks, bonds and gold made the ride much smoother over 23 years, but no mix or rotation rule reliably earned more than the S&P 500. There are also years when stocks and bonds fall together.
A note on fairness: the final-exam data was never used to choose anything, but the person running the research knew in broad terms what happened in those years. The ready-made portfolios on this site are the ones picked before the exam, with their exam results shown honestly. Scripts are in the research folder.
Round three: trying to beat holding
Every robot above could only win by dodging crashes, because it never held more than 100% in the market. To earn more than holding, a robot has to sometimes hold more than 100%, using leverage (borrowed money), or pick something better than the market. Round three tried four ideas:
- A. Leverage with a trend safety switch.
- B. Volatility steering: hold more when the market is calm, less when it is wild.
- C. More clues: trend, momentum, calm markets, the yield curve, corporate-bond stress and the fear index.
- D. Sector rotation among 10 industries.
A tougher bar. To count as better, a robot had to earn more per year than holding and have a worst drop no bigger than holding's. Without that second condition, simply borrowing to double up would win.
Fresh exams. The 2021–2026 years had already been used, so this round added Ken French's research data: US stock returns including dividends, and T-bill rates, back to 1926.
- 2001–2020: designing.
- 1950–2000: a fresh exam that no robot had ever seen.
- 1928–1949: a stress test that includes the Great Depression.
The simulated leverage was checked against the real 2x and 3x funds and came within 0.2–0.7% a year of them. The borrowing cost was then set slightly higher, to err on the safe side.
| Robot | Growth per year · worst drop | |||
|---|---|---|---|---|
| 1950–2000 exam | 1928–1949 stress | 2021–2026 | 1928–2026 | |
| Just holding | 12.7% · 48% | 3.9% · 84% | 14.0% · 26% | 9.6% · 84% |
| Gentle boost (1.5x + trend switch) | 13.9% · 47% | 6.7% · 54% | 12.5% · 26% | 11.5% · 54% |
| Smooth boost (trend + volatility steering) | 16.0% · 39% | 8.4% · 64% | 12.8% · 22% | 12.8% · 64% |
| Moderate boost (2x + trend switch) | 15.4% · 57% | 9.7% · 63% | 12.9% · 42% | 13.5% · 63% |
| Bold (3x + trend switch) | 21.6% · 75% | 8.3% · 89% | 10.4% · 67% | – |
| More clues (trend + calm, up to 3x) | 13.4% · 46% | −3.2% · 95% | 11.7% · 34% | – |
| Sector rotation (top 2 of 10) | 14.1% · 50% | 4.5% · 85% | 9.5% · 35% | – |
Green means it beat holding by the tougher rule in that period. These research numbers use the whole US stock market; on this site the robots trade the S&P 500 fund (SPY) and a 2x S&P 500 fund (SSO). They check the trend every day and act on the next day's price.
What was learned.
- Gentle boost is the most dependable. It was the only robot my rule picked that beat holding in both fresh tests.
- Smooth boost had the best fresh-exam numbers, but my rule didn't pick it, because it trailed holding in 2011–2020.
- Moderate boost earned the most of the sensible options, but it failed the 1950–2000 exam. On Black Monday, 19 October 1987, the market fell 17% in a single day. The robot's switch only checks the closing price, so it was still fully boosted and lost about 35% that day. Its worst drop reached 57%, more than holding's worst in those years (48%).
- More clues overfit. They fitted recent decades and collapsed in the Depression, with a 95% drop. 3x leverage made the most money but had drops of 75–89%.
- None of them beat holding in 2021–2026. All of them lose more than holding in some years: the leveraged robots lost 25–32% in 2000, and Moderate lost 35% in 2022.
About real leveraged funds. 2x and 3x funds reset every day, so over long choppy stretches they can lose even when the market ends up flat. They are built for short-term trading. On this site their history before 2006 (2x) and 2009 (3x) is simulated from the S&P 500 fund and T-bill rates, with the real funds' costs. Idle money in these robots earns T-bill interest through a Treasury-bill fund (BIL), simulated before 2007.
The crash trigger (for boost bots)
The boost bots' trend switch only looks at closing prices, so a crash that happens within a single day can hit before it reacts. That's what sank the 2x bot on Black Monday 1987. The optional crash trigger sells the stock positions the moment the S&P 500 falls a set amount below the previous close. The daily bot does this with real stop orders at Alpaca, refreshed every morning.
- The design years couldn't choose a setting. From 2001 to 2020, no 6% one-day fall ever happened while a bot was boosted, and lower triggers (3–5%) fired on ordinary rough days and cost money.
- On older years it helped a lot. In 1950–2000, a 6% trigger cut Moderate 2x's worst drop from 57% to 44%, and Gentle's from 47% to 36%. Over August–December 1987, Moderate lost 31% instead of 48%. Those years had been seen once before, so this is supporting evidence rather than a clean exam. They only have one price a day, so the test assumed the sale filled 1% worse than the trigger.
- On the site's real daily highs and lows (2001–2026) it cost a little. On 6 May 2010, the "Flash Crash", the market plunged 10% within minutes and recovered to close 3% down, and the trigger sold near the bottom. On 9 March 2020 it helped: the market fell another 18% over the next 10 days.
- A 6% one-day fall happened on only 35 days between 1926 and 2026, almost all in real crises. The trigger is off by default because the evidence is mixed; switch it on in a boost bot's settings.
Tools for honest testing
- History back to 1926. Pick US stock market since 1926 in the stock list, or Whole US market since 1926 for a boost bot, then choose an era like the Great Depression in "Years to test". It is Ken French's research data (the whole US market, with dividends), continued with the S&P 500 fund after the research data ends. It has one price per day, so trades happen at the next day's close. Over 1928–2026 the Crash shield grew 10.2% a year against 10.0% for holding, with a worst drop of 54% against 84%.
- Taxes. Under "Money and costs", switch on estimated US tax. Gains held under a year are taxed at the short-term rate, the rest at the long-term rate. Losses offset gains, and tax is paid each year end. Just holding is taxed once, as if sold at the end, which is why trading robots usually fall further behind after tax. For example, the Crash shield on SPY drops from about $85,000 to $65,000 after tax. It is an estimate, not tax advice.
- How much was luck? Under any result, this runs the robot and just holding through 300 alternative histories. Each keeps every real day but shuffles year-long chunks into a new order. If a robot only wins in the real order, the win may have been luck. The Crash shield on SPY ended with more money than holding in about a quarter of them, and had a smaller worst drop in about 85%: crash insurance, not a money-maker. Shuffling breaks up some long trends, so trend robots look a little worse here than in real markets.
- Beat the robot (the Play tab). Trade a hidden stretch of history yourself and see whether you do better than a robot and just holding.
Honest limits
- Survivorship bias: the stock list is made of companies that are big and successful today. A strategy tested on Nvidia or Apple benefits from knowing they survived. Index funds like SPY avoid most of this.
- Daily prices only: one price per day (open, high, low, close). Nothing happens between days except stop-loss, take-profit and trailing-stop checks against the day's high and low.
- Prices are adjusted for stock splits and dividends, so dividends are counted as if reinvested, for both the robot and buy & hold.
- Past results don't guarantee future results. This is a learning tool, not financial advice.
Where the prices come from
Daily prices for 61 US stocks and funds are downloaded from Yahoo Finance every weeknight after the market closes, by a GitHub Action in this project's repository. Live prices come from your own free Finnhub key, or from your Alpaca account (the IEX exchange feed, free with any Alpaca account).