How to Backtest on thinkorswim: Strategy Report, OnDemand, thinkBack

You can backtest on thinkorswim three ways, and they are three different tools. The Strategy Report runs a coded rule over the bars on a chart and lists every hypothetical trade. OnDemand replays a past trading day so you can place simulated trades by hand. thinkBack, on the Analyze tab, rebuilds past option chains so you can test an options position. None of the three can send a live order.
This page walks through each tool with the steps from thinkorswim's own manual, then shows what the Strategy Report leaves for you to check. We took the example rule from the manual's thinkScript tutorial, ran it on eight stocks and funds from January 2021 to November 2026, and changed one assumption at a time. Filling at the signal day's close instead of the next day's open moved the total by a median 9 percentage points per ticker. Sliding a one-year chart window moved Nvidia's result from a 62% loss to a 127% gain. Same rule, same stock.
thinkorswim's three backtesting tools in one table
| Tool | Where it is | What it tests | How trades get in | What you get back |
|---|---|---|---|---|
| Strategy Report | On a chart, after you add a strategy in Edit Studies and Strategies | A rule written as conditions, on every bar on the chart | Automatically, as buy and sell signals | A table of every hypothetical trade, with profit or loss per trade and in total |
| OnDemand | The OnDemand button in the upper-right corner of the platform | Your own decisions on a past trading day, replayed | By hand, in a simulated account | A session you can step through, pause, fast forward and reset |
| thinkBack | The Analyze tab | An options position entered on a past date | By hand, by clicking the bid or ask in that day's option chain | Profit or loss and other metrics for the position on any date you pick |
If your question is "would this rule have worked," you want the Strategy Report. If it is "would I have handled that day," you want OnDemand. If it is about an option spread, you want thinkBack. For practice on today's market instead of the past, thinkorswim has a fourth tool, covered in our paperMoney guide.
How to backtest a strategy on a thinkorswim chart
The steps below follow the manual's Strategy Report page and its pages on strategy setup, which describe the desktop platform.
- Open a chart of the symbol and set the time frame. The report is built from the signals on the chart, so the time frame decides how much history is tested. The manual's example uses a chart set to one year of daily bars.
- Open the Studies menu and choose Edit studies. In the Edit Studies and Strategies window, go to the Strategies tab.
- Add a strategy. The predefined ones carry a suffix that says what they do: LE is a long entry, SE a short entry, LX a long exit and SX a short exit. The manual says strategies "should be used pairwise," an entry together with something that exits it.
- Click Global strategy settings at the bottom of the window to set the default trade size and how many entries in the same direction are allowed. The manual notes these settings "are only applied to the current chart."
- Apply the changes. Buy and sell arrows appear on the chart wherever the conditions were met.
- Right-click any signal arrow and choose Show Report.
The report is a table with one row per signal. Its columns, as the manual lists them, are Strategy, Side, Quantity, Amount, Price, Date/Time, Trade P/L, P/L (the running total) and Position. Under the table you see the maximum trade profit or loss, the total profit or loss for closed positions and the number of orders.
Writing your own rule in thinkScript
A strategy is a study with one extra function. The manual's tutorial chapter on strategies says the AddOrder function "will turn any technical indicator into trading strategy," and its example is a moving average crossover. It defines avg as the 20-period simple average of the close, then adds two lines:
- AddOrder(OrderType.BUY_AUTO, price crosses above avg);
- AddOrder(OrderType.SELL_AUTO, price crosses below avg);
BUY_AUTO buys to open a long position or to close a short one, and SELL_AUTO does the reverse, so that pair is always either long or short. The tutorial also lists constants that only open or only close a position; BUY_TO_OPEN paired with SELL_TO_CLOSE tests the long side alone. The full form of the function, in the AddOrder reference, also takes a price and a trade size. The price matters more than it looks, and the next section is about why.
What the Strategy Report counts and what it leaves out
- The fill price is whatever the script says. If the script says nothing, the reference gives the default as open[-1], which the tutorial spells out as "the Open of the following bar." The order "will be added to the next bar after condition is fulfilled." A script can name a different price, such as the close of the signal bar.
- The history is the chart. A one-year daily chart tests one year. Load five years and the same rule is tested on five.
- The size is a fixed quantity per signal, set in Global strategy settings or in the script, so profit and loss reflects that quantity. It is not a percentage of an account, and unless the script computes its own size it does not grow or shrink with results.
- Costs are not in the manual's list. None of the nine columns is a commission, a fee or slippage, and the manual's pages on strategies do not mention any of the three. Treat the totals as before costs unless your own screen shows otherwise.
- Open profit can be plotted. Ticking "Display FloatingPL study with strategies" in Global strategy settings adds a lower panel that shows, for each bar, the profit or loss "if the position were exited at the Close price."
- The signals are not orders. The tutorial chapter closes with this notice: "all the signals you get are hypothetical, i.e., you cannot send real orders using strategies."
How to backtest by hand with OnDemand
The Learning Center's Analyze FAQ describes OnDemand as a feature that "replays historical market data from a trading day you select." The steps it gives:
- Click the OnDemand button in the upper-right corner of the platform.
- Pick a date and time in the calendar selector and click Go.
- Use the playback controls in the toolbar: step backwards, step forward, pause, play and fast forward at three times speed.
- Place trades as the session plays. They go to a simulated account.
- To start over, open the Reset menu. Reset time returns to the start of the selected date. Reset account restores the simulated account to its default state.
- Click the OnDemand button again to leave and return to live data.
OnDemand tests you more than it tests a rule. Every trade is one you place, so it suits rehearsing a setup on a known day, an earnings morning or a Fed afternoon, and checking whether you would have followed your own plan. It does not run a coded rule across years of bars. That is the Strategy Report's job.
How to backtest options with thinkBack
The manual describes thinkBack as a feature "designed for option back-testing" that "stores nearly a decade of historical option trade data." It sits on the Analyze tab. To test a past trade:
- Type the underlying symbol in the symbol selector.
- Choose a past date in the date picker. thinkorswim opens the option chain as it stood on that date.
- Click the Ask column to buy an option or the Bid column to sell one. That enters a hypothetical trade and activates the Backtrades section.
- Read the position's metrics there, including profit and loss. Pick a later date and the numbers update to that date.
The same FAQ carries the warning that applies to all three tools: "Backtesting is the evaluation of a particular trading strategy using historical data. Results presented are hypothetical, and there is no guarantee that the same strategy implemented today would produce similar results."
We ran the manual's example on eight tickers. Three things moved the answer
To see how much a Strategy Report depends on its settings, we rebuilt the tutorial's rule outside thinkorswim and ran it on daily bars for eight heavily traded stocks and funds, January 4, 2021 through November 13, 2026. We used the long side only: buy when the close crosses above its 20-day simple moving average, sell when it crosses back below. That produced 628 completed trades, about 14 a year per ticker. Results below are each trade's percentage gain or loss added up, which is what you get by putting the same dollar amount into every trade.
This is not a verdict on the rule. A moving average crossover is the manual's teaching example and we chose it for that reason. The point is how far the report moves when the rule stays the same. For scale, these were years in which most of these prices rose a great deal, and a single purchase held for the whole period ended with a larger gain than the rule's total on 7 of the 8 tickers.
1. The fill price
The default fill is the next bar's open. A script can be written to fill at the signal bar's close instead. Across 1,256 entries and exits, the next day's open sat a median 0.65% away from the signal day's close, and 1% or more away on 36% of them. The direction was a coin flip: the open was the worse price for the trader on 50% of fills. But the differences did not cancel out ticker by ticker.
| Ticker | Trades | Winning trades | Total, filled at the next open | Total, filled at the signal close | Difference in points |
|---|---|---|---|---|---|
| SPY (S&P 500 ETF) | 83 | 43% | +28% | +26% | -2.0 |
| QQQ (Nasdaq-100 ETF) | 81 | 31% | +53% | +59% | +6.2 |
| Apple | 67 | 42% | +90% | +102% | +11.7 |
| Amazon | 84 | 37% | +54% | +41% | -13.1 |
| AMD | 73 | 32% | +274% | +274% | -0.1 |
| Nvidia | 80 | 34% | +222% | +247% | +25.1 |
| Palantir | 80 | 36% | +135% | +138% | +3.0 |
| Tesla | 80 | 31% | +133% | +156% | +23.3 |
Changing nothing but the fill price moved the total by a median 9 points, from 13.1 points lower on Amazon to 25.1 points higher on Nvidia. Filling at the close gave the bigger total on 5 of the 8 tickers and the smaller one on the other 3. Neither assumption is the flattering one every time, which is the trouble: you cannot correct for it with a rule of thumb. The whole difference is the overnight gap between one day's close and the next day's open, and Schwab extended hours trading has our measurements of how large those gaps run.
2. The chart's time frame
The manual's example reads the report off a one-year daily chart. So we cut the same history into one-year windows, a new one starting every 21 trading days, 59 windows per ticker, and read the rule's total in each. A typical window held 13 trades.
| Ticker | One-year windows with a gain | Worst window | Best window | Median window |
|---|---|---|---|---|
| SPY (S&P 500 ETF) | 42 of 59 | -17% | +21% | +5% |
| QQQ (Nasdaq-100 ETF) | 48 of 59 | -10% | +32% | +9% |
| Apple | 49 of 59 | -14% | +35% | +18% |
| Amazon | 51 of 59 | -16% | +52% | +11% |
| AMD | 51 of 59 | -34% | +148% | +30% |
| Nvidia | 42 of 59 | -62% | +127% | +38% |
| Palantir | 43 of 59 | -39% | +151% | +19% |
| Tesla | 49 of 59 | -26% | +76% | +29% |
Across all 472 windows the rule showed a gain in 375, or 79%. Every one of the eight tickers had at least one losing window. On Nvidia the window that began in May 2024 showed a 62% loss, across 20 trades in a year when the stock itself ended 30% higher, and the one that began in July 2022 showed a 127% gain. Even on SPY the range ran from -17% to +21%. A report read from one chart is one of those windows, and nothing on the screen tells you which.
3. Costs and a handful of trades
The rule traded about 14 times a year. At an illustrative 0.05% a side for spread and slippage, that is 1.4 percentage points a year at the median. On SPY, 83 trades added up to 28.0% before costs and 19.7% after: the cost took 30% of the total. The faster a rule trades and the smaller its edge, the more this line decides the outcome.
The results were also thin at the top. Only 36% of the 628 trades made money, and the median trade lost 1.0%. The totals came from a few long runs. On the median ticker the three best trades added up to 99% of the whole total, and on 4 of the 8 they equaled or exceeded it, meaning every other trade combined added nothing or lost money. A one-year report with a dozen trades may contain one of those runs or none.
Five checks before you believe a thinkorswim backtest
- Read the price in every AddOrder line. Know whether the test filled at the next open, the signal close or something else, and rerun it the other way.
- Change the time frame. Run the same rule on several different years and on a longer chart before reading anything into one report.
- Count the trades. A total built on a dozen signals is closer to an anecdote than a sample.
- Subtract costs yourself. Multiply the number of orders by a realistic cost per order and take it off the total.
- Look at the largest trades. If two or three rows carry the whole result, ask what the report looks like without them.
These are the checks specific to this tool. The general traps, tuning a rule until the past looks perfect, or testing only on stocks that survived, are in how to backtest a trading strategy. For a longer look at what moving average signals have done, see every S&P 500 golden cross and death cross since 1950.
From a backtest to live orders at Schwab
A thinkScript strategy stops at the chart. To act on a rule in a Schwab account there are three routes. You can place the orders yourself when the signal shows. You can attach a study-based condition to a single order in thinkorswim, which sends or cancels that one order when the condition is met; can you automate thinkorswim covers how far that goes, and the stop and bracket order guide covers the exit orders. Or software can place orders through Schwab's Trader API, either your own code or an app you connect to the account, as described in how to automate trading in a Schwab account.
JorgAI is one of those apps, and it has a backtest page of its own, so here is what ours assumes, read from our own code. It runs preset rule types on daily closing prices and takes an estimated 0.05% off every simulated stock fill for spread and slippage. Both facts are printed under each result. It is a test on closing prices, so the fill caution above applies to it as much as to a thinkScript strategy that fills at the close.
Quick answers
Does thinkorswim have backtesting?
Yes, in three forms. The Strategy Report backtests a coded rule on a chart, OnDemand replays past trading days for manual practice, and thinkBack backtests options positions on past option chains.
How do I open the Strategy Report in thinkorswim?
Add a strategy to a chart from the Strategies tab of the Edit Studies and Strategies window, then right-click any buy or sell arrow on the chart and choose Show Report.
What is thinkBack?
thinkBack is the options backtesting tool on thinkorswim's Analyze tab. The manual says it stores nearly a decade of historical option trade data. You pick a past date, enter a hypothetical trade from that day's option chain and read its profit or loss on later dates.
What is OnDemand in thinkorswim?
OnDemand replays historical market data from a trading day you choose. You start it from the OnDemand button in the upper-right corner, place simulated trades as the day plays, and can pause, step, fast forward or reset.
Can a thinkScript strategy place real trades?
No. thinkorswim's tutorial says strategy signals are hypothetical and "you cannot send real orders using strategies." Live automation in a Schwab account runs through conditional orders or the Trader API.
Does the thinkorswim Strategy Report include commissions or slippage?
The manual's list of report columns has no commission, fee or slippage column, and its strategy pages do not mention them. Subtract your own estimate of costs from the total.
How far back can you backtest on thinkorswim?
For the Strategy Report, as far as the bars on your chart go, so a longer time frame tests more history. For thinkBack, the manual says nearly a decade of option data.
Why does my thinkorswim backtest not match live trading?
The usual reasons are the ones measured above: the fill price assumed, costs left out, and a result that depended on one stretch of history. In our test the next day's open was a median 0.65% away from the signal close.
Sources, read November 19, 2026: the thinkorswim Learning Center's pages on the Strategy Report, strategy setup, entry and exit strategies and global strategy settings; its thinkScript tutorial, Chapter 7, Creating Strategies; the AddOrder and FloatingPL reference pages; the Analyze manual page and the Analyze FAQ; and JorgAI's own code for its backtest page. The test uses Yahoo Finance daily prices, adjusted for splits, through November 13, 2026, and is arithmetic by JorgAI: 628 completed trades across eight tickers, a trade still open on the last day left out of the totals. thinkorswim, thinkScript, thinkBack and paperMoney are names of Charles Schwab & Co., Inc., and JorgAI is not affiliated with or endorsed by Schwab.
If you want rules you set once to place the orders in your own Schwab account, connecting a Schwab account to JorgAI takes a few minutes, and the start page walks through the settings before any order is placed.
This article is education, not investment advice or a recommendation of any broker, security or strategy. Every result here is hypothetical: it comes from applying a rule to past prices, it leaves out taxes and assumes fills that real orders may not get, and past results do not indicate future results. JorgAI is software that carries out the rules you set in your own brokerage account; it is not an investment adviser. Trading involves risk of loss.
More in Getting Started
Keep reading
Let the AI do the trading.
Set it up in minutes. 7 day free trial on Starter, Plus and Pro.
Get started freeGet the weekly market read and new tools by email
One email a week: what moved, what the data says, and the next free tool when it ships. No spam, unsubscribe in one click.
More from the blog
Every other post, newest first
260 more posts
Stops, targets and a daily loss limit, enforced for you.
JorgAI runs the rules you set inside your own brokerage account. Zero withdrawal permissions, disconnect anytime.
Showing 18 of 260. Keep scrolling.




















