Skip to main content
On this page

How to Backtest on ThinkorSwim: Step-by-Step Guide for All 3 Tools

· 6 min read
Pineify Team
Pine Script and AI trading workflow research team

Thinkorswim has three different ways to examine historical trading ideas: thinkBack for historical options scenarios, OnDemand for replaying market activity, and chart strategies for applying repeatable rules to chart data. Choose the tool by the question you want to answer; their results are not interchangeable.

How to Backtest on ThinkorSwim: Step-by-Step Guide for All 3 Tools
Your taskToolWhat to check before trusting a result
Compare a specified options position on historical datesthinkBackExact contracts, historical quotes, valuation date, and transaction costs
Practice decisions while a historical session unfoldsOnDemandReplay clock, available data, order handling, and a saved decision log
Apply entry and exit rules repeatedlyChart strategiesSource rules, loaded chart history, simulated prices, and trade size

1. Use thinkBack for a defined options scenario​

In the desktop platform, open Analyze → thinkBack, enter the underlying symbol, and choose a historical date. Expand the expiration and find the strike and option type you want to examine. Clicking an ask creates a simulated purchase; clicking a bid creates a simulated sale. Review the resulting position in Backtrades and change the valuation date to examine its displayed profit or loss. These controls are described in Schwab's Analyze manual.

Start with one fully specified position. Write down:

  • Underlying, expiration, strike, call or put, long or short, and number of contracts.
  • Entry date, the displayed bid and ask, and the price used for the simulated entry.
  • Valuation or exit date, price assumption, and treatment of commissions and contract fees.
  • Any expiration, exercise, assignment, or corporate-action assumptions relevant to the position.

A historical quote snapshot does not prove that a particular order would have filled at that price. For a spread, preserve the details of every leg and avoid assuming that the most favorable price on each leg was simultaneously executable.

Use the worksheet to answer a narrow question, such as how the same contract's displayed value changed between two dates. To compare strategies, use the same underlying dates and consistent fill assumptions. A large dollar P/L without the contract details, capital committed, and costs is not a reproducible options result.

2. Use OnDemand to rehearse a historical session​

OnDemand supplies a replay clock. It is useful when your question concerns the sequence of decisions: whether you recognized a setup before seeing the outcome, when you submitted an order, and how you handled an exit.

  1. In thinkorswim desktop, select OnDemand in the upper-right area.
  2. Open the date/time control, choose an available historical point, and select Go.
  3. Allow the selected data to load and confirm the replay time before placing a simulated order.
  4. Use the playback controls to pause, advance, or change replay speed.
  5. Review the position and orders, then record what happened before resetting the session or leaving OnDemand.

Schwab documents these controls in its Analyze FAQ. Historical data availability and loading should be checked in the platform for the instrument and date you select; this guide does not promise coverage for every date or contract.

Keep a timestamped decision log. Record the information visible when you entered, the intended stop or target, the simulated fill, and any skipped setup. Rewinding after a losing trade and choosing a better entry is useful for studying a chart, but that revised outcome should not be counted as an independent test.

OnDemand and paperMoney serve different tasks. OnDemand replays history; paperMoney lets you practice in a simulated account using current market conditions. Schwab distinguishes them in its thinkorswim getting-started guide.

3. Use chart strategies for repeatable signal rules​

Open a chart, select Studies → Edit Studies, then use the Strategies tab to add the strategy you want to examine. Review its inputs and global strategy settings, including trade size. If using custom thinkScript, inspect both entry and exit conditions rather than assuming a chart study places simulated orders. See Schwab's strategy setup instructions.

Chart strategies display hypothetical orders. The thinkScript AddOrder function adds an order for the next bar when its condition is true; its default price is the next bar's open. A custom price argument changes that assumption. This is documented in the AddOrder reference.

To inspect results, right-click a strategy's buy or sell signal arrow and choose Show Report. The official report includes order side, quantity, price, time, trade P/L, cumulative P/L, and position. Its summary includes maximum trade P/L, total closed P/L, and the number of suggested orders. Maximum trade P/L is not maximum drawdown. See Schwab's Strategy Report reference.

Before comparing reports, keep chart interval, loaded history, session settings, and position sizing consistent. Examine several signals against the source rules. Do not assume a displayed P/L includes your commission schedule, bid/ask spread, or slippage; inspect the tool's assumptions and maintain a separate cost-adjusted calculation when necessary.

A record that makes a backtest reviewable​

Save the strategy version or full options specification alongside its settings, dates, and trade log. Separate the period used to choose parameters from a later period used to evaluate them. Include skipped and losing trades, not just the best chart examples.

For a rules-based system, compare net P/L after modeled costs, drawdown, trade count, and capital exposure. For a discretionary replay, also report which decisions were made before advancing the clock. If you calculate a metric outside the platform, identify its formula and input records.

A fixed percentage deduction cannot represent every instrument's execution costs. Use the applicable fee schedule and test plausible spread and slippage assumptions. Historical simulations help identify rule errors and sensitivity to assumptions; they do not verify future profitability or live execution quality.

The Best Pine Script Generator