Skip to main content

thinkorswim Backtesting: Master Trading Strategy Testing with Pro Tools

· 18 min read

If you're testing a trading idea, whether it's your first or your hundredth, thinkorswim backtesting is like having a time machine for your strategy. It lets you run your trading rules through years of past market data, so you can see how they would have played out, all without placing a single real trade. The best part? If you have a Charles Schwab account, you already have free access to this powerful toolkit on thinkorswim. This guide will break down how to use all its features, step-by-step, to help you build and refine your approach with more confidence.


thinkorswim Backtesting: Master Trading Strategy Testing with Pro Tools

What Is Backtesting and Why Does It Matter?

Simply put, backtesting is like a rehearsal for your trading strategy. You define a set of rules (when to buy, when to sell) and then apply those rules to old market data. The platform shows you the hypothetical results: how much you might have made or lost, how often the trade worked, and how you would have navigated different markets. For those developing systematic approaches, understanding tools like the Pine Script Volume indicator can be crucial for adding confirmation to your signals.

It matters because it helps you answer a critical question: "Does my idea actually hold up?" It can reveal flaws in your plan—like if a strategy only works in a roaring bull market but falls apart during volatility—before you risk your hard-earned money. It also trains you to stick to your plan, because you've already seen how the rules play out over hundreds of past scenarios.

While a great backtest doesn't guarantee future profits, it's an incredibly useful tool for comparison. It helps you see which of your strategy ideas has been more resilient over time and across different conditions, giving you a much stronger foundation for your final trading plan. Most experienced traders won't place a trade without testing it this way first; it’s that essential.

How to Pick the Right thinkorswim Backtesting Tool for You

Getting started with backtesting in thinkorswim can be confusing because the platform has a few different tools with similar names. Using the wrong one is like trying to hammer a nail with a screwdriver—it’s frustrating and doesn't give you the results you want.

The key is to match the tool to your specific goal. Here’s a straightforward breakdown of the three main features, what they’re actually for, and where to find them.

ToolBest ForAccess Location
thinkBackSimulating P&L of past trades (stocks & options)Analyze tab → thinkBack
thinkOnDemandPaper trading on historical data in real timeTop-right "OnDemand" button
Custom Strategies (Strategy Report)Automated, rule-based signal backtestingCharts → Studies → Strategies

Let’s look at each one so you can see which fits your needs.

1. thinkBack: The "What If?" History Tool

Think of thinkBack as a time machine for your trading ideas. Let's say you had a hunch about a stock last month but didn't pull the trigger. With thinkBack, you can plug in that exact trade—with the entry price, date, and order type—and see a detailed profit and loss simulation as if you had actually placed it.

It's perfect for reviewing specific, one-off trades you considered or for understanding how a particular stock or option moved in the past. You’ll find it under the Analyze tab.

2. thinkOnDemand: Real-Time Practice in the Past

This is the tool for practicing your live trading skills, just in a previous time period. When you turn on thinkOnDemand, the whole platform "rewinds" to a date you choose. You can then paper trade in real-time using the actual market data from that day, week, or year.

It’s invaluable for testing your gut reactions, practicing order entry, and getting a feel for market conditions during famous events (like a market crash or a Fed announcement) without any risk. Hit the "OnDemand" button at the top of your platform to start.

3. Strategy Report: Your Automated Rule Tester

If you have a strict set of rules for when to buy and sell (like “buy when the 50-day moving average crosses above the 200-day”), the Custom Strategies tool is your best friend. You build or apply a set of rules, and it automatically scans years of historical data to generate a report showing every signal, the theoretical results, and key stats like win rate. Mastering the logic of exits is just as important as entries; for deeper insights, explore our guide on Pine Script Strategy Mastering Trailing Stops for Better Trading Results.

This is for systematic, hands-off testing of a trading strategy. You access it by adding a "Strategy" study directly to your chart.

Picking the right tool from the start saves you a ton of time and gives you the clear, useful answers you're looking for. Now, let's get into the details of how to use each one.

thinkBack: See How Your Trading Ideas Would Have Played Out

Ever had that “what if” feeling about a trade? What if you had bought that stock last month, or sold those options before the earnings report? thinkBack lets you travel back in time to test those ideas, so you can learn from the market’s past without risking a dime.

You’ll find thinkBack in the Analyze tab of thinkorswim. It’s built for simulating the profit and loss of trades you could have placed on any historical date. Pick your starting point, plug in your hypothetical trades, and then scroll forward in time to watch the results unfold.

A Step-by-Step Walkthrough

Using thinkBack feels like having a time machine for your trading journal. Here’s how it works:

  1. In thinkorswim, go to Analyze → thinkBack.
  2. Click the calendar in the top-right to choose your starting date—the day you wish you had entered the trade.
  3. Add your simulated trades to the worksheet. You can test stocks, options, or complex combinations. For instance, try buying 100 shares of a company, or setting up a call option spread.
  4. Here’s the magic part: use the P&L Date slider to move forward from your start date, day by day or week by week, to see your gains or losses change over time.
  5. Review the clear results table that breaks down the performance for each leg of your trade and gives you a total.

Why Options Traders Find It Invaluable

This tool is a game-changer for anyone trading options. It allows you to dissect how a specific strategy—like an iron condor or a simple long call—would have reacted to real historical market conditions.

You can observe the actual effects of time decay (theta) on your position, see how shifts in market volatility (vega) would have impacted your P&L, and track how the delta (or directional exposure) moved. It’s one of the best ways to ground your strategy testing in real market data, helping you understand not just if a trade would have worked, but why.

Think of it as your personal trading history lab—a safe space to experiment and learn from what the market has already shown us.

thinkOnDemand: Your Trading Time Machine

Think of thinkOnDemand (most traders just call it "OnDemand") as your personal time machine for trading. It takes the idea of backtesting and makes it feel real. Instead of just looking at a final profit or loss number, you get a virtual $100,000 account to trade with against historical data. You move through old market days, candle by candle, making decisions in simulated real-time just like you would if you were there.

The platform lets you go back roughly 14 to 15 years in time. This is huge because it means you can practice trading through all sorts of markets—the big rallies, the scary crashes, and the choppy, uncertain periods. And the best part? You can use it any time, day or night, even on weekends. It’s perfect if your schedule doesn't line up with live market hours.

What You Can Do With thinkOnDemand

  • Relive Any Trading Day: Pick any date from the past ~15 years and replay the session from open to close.
  • Control Time: Speed through boring periods or rewind to see a key moment again, testing how you'd react.
  • Watch a Portfolio Grow (or Shrink): See how your simulated trades would have performed over days or weeks, using the virtual capital.
  • Use Your Favorite Tools: Apply all the technical indicators and drawings on the historical chart as the "live" simulation runs. For example, you could test how an Adaptive Moving Average Indicator TradingView strategy would have performed in past conditions.
  • Start Over Instantly: Blow up your virtual account? No problem. Just reset and start fresh with a clean $100,000.

Helpful Hints for a Smooth Experience

  • Watch the Clock: Make sure the date and time you choose is during actual market hours. If you pick a weekend or overnight, the chart timer won't move.
  • Give it a Second: When you load a new day, be patient. It can take a few moments to buffer the historical data, especially on older machines.
  • If Things Get Slow: OnDemand can be demanding. If it freezes or shows a constant hourglass, try two things:
    1. Give the thinkorswim platform more memory in its settings.
    2. Keep your watchlist in the simulation relatively small.
  • One Important Limitation: Just know that Dynamic Watchlists and Scans won't work inside the OnDemand mode. You're trading based on the historical chart in front of you.

Going Beyond Presets: Custom Strategies & The Strategy Report

If you're serious about testing a trading idea and want to move past manual checks, thinkorswim's Custom Strategies are your best friend. It's for when you have a specific set of rules and think, "I wish the computer could just test this for me, everywhere, all at once." That's exactly what this does. You write your entry and exit logic in thinkScript, and the platform automatically runs through years of chart history, marking every single hypothetical trade.

The real magic happens when you pair it with the Strategy Report. This report doesn't just show you signals; it tallies everything up to show you the estimated profit or loss, your win rate, and your biggest losing streaks, giving you a clear, numbers-based picture of how your idea actually would have performed.

This process of translating a trading concept into testable code is where many traders hit a wall. Writing reliable, error-free logic for backtesting is a specialized skill. For those looking for a more streamlined and powerful approach, especially for TradingView users, modern tools have evolved to handle this complexity. Platforms like Pineify allow you to build, test, and optimize sophisticated strategies visually or with an AI assistant, generating professional-grade Pine Script code without the manual coding hassle. You can instantly backtest any indicator, run multi-parameter optimizations, and generate deep performance reports—all from a single interface.

Pineify Website

How to Run a Strategy Backtest (Step-by-Step)

Let's walk through how you'd actually do this. It sounds technical, but the process is pretty straightforward once you know where to click.

  1. Open a chart for the stock or ETF you want to test.
  2. Click on Studies → Edit Studies.
  3. Switch to the Strategies tab. Here, you can either pick a pre-built strategy to play with or hit "Create" to start writing your own from scratch.
  4. A great one to start with is MovAvgTwoLineStrat. It's a simple moving average crossover strategy. Try testing it over 5 or 10 years on a daily chart to see the long-term results.
  5. In your thinkScript code, you'll use AddOrder() functions to define exactly when to buy and sell.
  6. Once applied, open the Strategy Report from the lower pane of your chart. This is where you get the full story: a P&L curve, a list of every trade, your win rate, and drawdown metrics.
  7. You can even export the whole report table to a spreadsheet to sort and analyze the data your own way.

The report takes all those buy and sell markers on your chart and does the math for you. You can compare two different strategies on the same chart, tweak a number (like the length of a moving average), and instantly see if performance improves—across different tickers and time periods.

Key Tips for Accurate thinkScript Backtesting

To make sure your backtest reflects realistic trading, keep these pointers in mind:

  • Get Your Entry Time Right: In your AddOrder() code, set the entry time to open[-1]. This tells the system, "use the next bar's opening price," which simulates a real order being placed after a signal and filled at the next open. It's much more accurate than assuming you got filled at the closing price of the signal bar.
  • Watch Out for Multiple Time Frames: If your strategy uses rules from different charts (like a 1-hour and a daily chart), be extra careful. thinkorswim can sometimes generate a trade based on an incomplete higher-timeframe bar, and then delete it if that bar changes before it closes. This can skew your results.
  • Avoid "Fitting" to One Scenario: Always run your strategy on different symbols and across various date ranges (bull markets, sideways markets, bear markets). If you only optimize it for one stock during a raging bull market, it might fail miserably elsewhere. You want a robust idea, not a one-trick pony.

What You Should Know About Backtesting's Limits (Even with thinkorswim)

Backtesting is a powerful way to test your trading ideas, but it’s crucial to remember it’s a simulation, not a crystal ball. No platform, including thinkorswim, can perfectly replicate the real market. Knowing where the tool might fall short helps you take your results with the right grain of salt and avoid costly surprises.

Here are the key limitations to keep in mind:

  • Past results don't predict the future. This is the golden rule. Markets evolve. What worked in a low-volatility, bullish period might fail completely when conditions shift. The backtest shows you what would have happened, not what will happen.

  • thinkOnDemand can be a resource hog. Running complex tests on a large watchlist of symbols can really slow things down or even cause the platform to struggle. It’s best to start simple and scale up to see how your system handles it.

  • Real-world costs and fills aren't perfect. The simulation uses historical data for entry/exit prices, but it can't perfectly model the slippage (the difference between your expected price and your actual fill) or all commission nuances you’ll encounter live. Your actual profits may be slightly less.

  • Multi-timeframe strategies need extra scrutiny. If your strategy uses, say, a 4-hour chart signal to enter on a 1-minute chart, be cautious. The way the platform confirms the higher-timeframe candle can sometimes introduce inaccuracies in the backtest logic.

  • You can't use live scans while backtesting. Need to run a dynamic stock screener during your test session? You can't. The thinkOnDemand feature locks you into the historical data mode, so any scanning has to be done separately.

Finding the Tool That Fits Your Trading Questions

Picking a backtesting tool isn't really about the tool itself. It's about answering your specific trading question. The best choice is the one that lets you test your idea in the most straightforward way, without a bunch of extra steps or complexity you don't need.

Think of it this way: you have a historical market puzzle, and each of these tools is a different lens to examine it with. You just need to grab the right lens for the job.

Here’s a simple breakdown to match your goal with the right tool:

If you want to…Use this tool
Test how a specific options trade would have performedthinkBack
Simulate manual day trading in a past market environmentthinkOnDemand
Automate rule-based entry/exit signals and review statisticsCustom Strategies + Strategy Report
Develop and optimize a thinkScript-based systemthinkScript Strategy + Strategy Report

The key is to start with your question. Want to know "What if I had bought that call last week?" thinkBack is your quick answer. Want to feel what trading last Tuesday was really like, minute-by-minute? That’s the thinkOnDemand experience.

When your idea evolves into a set of clear rules—like "buy when this crosses above that, and sell after two days"—that's when you step into building a Custom Strategy to get all the performance stats. And if you live in thinkScript, the thinkScript Strategy tool is your natural workshop for building and refining those automated systems.

It just comes down to using the simplest tool that gets you the answer you're looking for.

Thinkorswim Backtesting FAQs

Got questions about testing your trading ideas on thinkorswim? You're not alone. Here are straightforward answers to the most common ones.

Is it free to use? Absolutely. If you have a Charles Schwab account, you get the thinkorswim platform at no cost, and all the backtesting tools inside it are included. You don't pay extra to use them.

How much historical data do I get? For the thinkOnDemand replay tool, you can go way back—about 14 to 15 years of market data. That’s a huge amount of history, covering everything from bull markets to crashes, which is perfect for seeing how a strategy might hold up.

Can I test options trades? Yes, and this is a real strength. The thinkBack tool is built with options in mind. It uses real historical prices for options, tracks expirations and strike prices, and shows how your profit and loss would have changed day by day.

How accurate are the results? It's pretty reliable for straightforward strategies, especially if you set up your entry logic correctly in the script. For more complex ideas that use multiple timeframes, the results can be less precise. The golden rule? Always double-check any strategy in paper trading with real-time data before risking real money.

Do I need to be a programmer? Not at all. You can dive right into thinkBack and thinkOnDemand without writing a single line of code. If you want to build Custom Strategies, knowing a bit of thinkScript helps, but there's also a full library of ready-to-go strategies you can test immediately.

Here’s a quick look at the three main tools:

ToolBest ForCoding Needed?
thinkBackTesting options strategies & scanning past performanceNo
thinkOnDemandReplaying & trading through past market days in detailNo
Custom StrategiesBuilding & testing your own unique trading systemHelpful, but pre-built strategies available

Your Next Move: Start Backtesting with Confidence

You've got the knowledge. Now, let's turn it into practice. Here's a straightforward path to get your first thinkorswim backtest up and running.

  1. Open thinkorswim and find thinkBack. Fire up the desktop platform for all the features. Head straight to the Analyze tab—that's where you'll find the thinkBack tool waiting.
  2. Take OnDemand for a spin. Get a feel for simulating the past by jumping into a known volatile period. Try March 2020 or September 2022. Practice placing trades in that fast-paced, historical environment without any real risk.
  3. Test a basic strategy. Keep it simple to start. Load a classic moving average crossover strategy into thinkBack. Run it on 5–10 years of daily data for a broad view, then dig into the Strategy Performance Report. Pay attention to the net profit and the max drawdown—these tell the real story.
  4. Start a simple journal. This is your secret weapon. After each backtest, jot down a few lines: what you tested, what the results were, and one key takeaway. Over time, this becomes your personal playbook for what works when the market gets choppy, trends, or goes sideways.
  5. Connect with others. Don't figure it all out alone. Places like the r/thinkorswim subreddit or the forums on usethinkscript.com are full of people doing the same thing. You can find ready-to-use thinkScript code, get help debugging a test, or just swap ideas.

Think of backtesting as building muscle memory for your trading decisions. The more you practice in thinkBack, the more prepared and less emotional you'll be when it's time to trade with real capital. Begin with one simple strategy, understand it inside and out, and let that proven knowledge build your confidence to move forward.