How to Backtest on ThinkorSwim: Step-by-Step Guide for All 3 Tools
Whether you're fine-tuning a day trading approach or trying out a new options idea, learning how to backtest on ThinkorSwim is like having a time machine for your trades. ThinkorSwim (TOS), TD Ameritrade's powerful platform (now part of Schwab), gives you three main ways to do this: thinkBack, thinkOnDemand, and Custom Strategies. These tools let you replay past market days to see how your ideas would have worked, all without using real money.
It’s the closest thing to a trading flight simulator you can get.
What Is Backtesting (And Why You’ll Want to Do It)
Simply put, backtesting means testing your trading plan against old market data. Instead of wondering, “Would this have worked?” you can actually see the results—like your historical win rate, average profit, and how much you might have lost during rough patches.
Think of it like this: you wouldn’t buy a car without taking a test drive. Backtesting lets you “test drive” your strategy through actual market history before you risk your hard-earned cash.
Here’s why it’s so useful:
- Checks if your logic holds up. Does your setup actually work, or does it just feel like it should?
- Shows you the weak spots. See how your strategy performs in crashing markets, roaring bull runs, and everything in between.
- Takes the emotion out. You're looking at cold, hard data instead of relying on a gut feeling.
- Builds real confidence. When you’ve seen how your rules played out over hundreds of past days, you can trade with more conviction.
The good news is ThinkorSwim bundles these tools right into the platform, making it straightforward whether you’re just starting or have been trading for years.
Finding the Right Backtesting Tool in ThinkorSwim
Trying to figure out which backtesting method in thinkorswim is right for you? The platform gives you a few different ways to look back in time and test your ideas, and each one has its own superpower. Think of it less as three random tools and more as a toolkit where you pick the wrench that fits the bolt.
Here’s a straightforward look at what each one does best, so you can stop guessing and start testing.
| Tool | What It's Perfect For | Where to Find It |
|---|---|---|
| thinkBack | Seeing the exact profit or loss of a potential stock or options trade on a past date. | Analyze tab → thinkBack |
| thinkOnDemand | Reliving the market, candle by candle, and placing simulated trades in that past moment. | OnDemand button (top right) |
| Custom Strategies | Checking if your specific chart-based entry and exit signals would have worked historically. | Charts → Studies → Edit Studies → Strategy tab |
thinkBack is your go-to for quick "what-if" scenarios, especially with options. Want to know what would have happened if you bought that call last Tuesday? This tool shows you the exact P&L graph as if you had.
thinkOnDemand is like a market time machine. It lets you replay any trading day at your own speed, with all the charts and tools live. You can even practice (paper trade) in that old market environment, which is incredible for getting a feel for how price actually moved.
Custom Strategies is for when you have a defined set of rules. Maybe you buy when a moving average crosses and sell on an RSI signal. You can code that logic (or use a built-in one) and the platform will visually mark every historic buy and sell signal on your chart, along with a performance report.
Method 1: How to Use thinkBack
Think of thinkBack as your trading time machine. Built right into ThinkorSwim, it lets you rewind the market and ask a powerful question: "What if I had placed this trade back then?" It’s a favorite for options traders looking to test strategies like spreads or covered calls against real, historical price action.
Your Step-by-Step Guide to thinkBack
Getting started is straightforward. Here’s how you do it:
- Log in to your ThinkorSwim platform.
- Head to the Analyze tab at the top of your screen.
- From the drop-down menu, click on thinkBack. Your screen will reset to a past date.
- Pick your starting point using the calendar in the top-right corner. Want to see how a strategy would have held up after a big event? Choose a date like March 23, 2020, and start from there.
- Build your theoretical trade. Just like you would in the normal trade tab, enter the stock or options contracts, strike prices, and expirations you want to test.
- Move time forward. Slide the P/L Date forward—day by day, week by week, or years ahead—to watch your simulated position change in value.
- Check your results. Your overall theoretical profit or loss is clearly summarized at the bottom of the window.
A Real-World Example: Imagine testing a simple recovery idea after the March 2020 crash. On March 27, 2020, you could simulate buying 100 shares of MSFT, 10 shares of AMZN, and 2 deep in-the-money FB call contracts. By setting the P/L Date to November 2021, thinkBack shows that bundle would have gained $72,552.80. It’s a compelling way to see the potential of a strategy, not just on paper, but against the messy reality of the past market.
Method 2: How to Use thinkOnDemand
Think of thinkOnDemand as a trading time machine. It lets you practice with real historical market data, walking through it candle by candle with a virtual paper trading account. Instead of just seeing a final profit or loss number, you get to experience the market's movements and test your decisions in real-time, just as if you were actually there in the past.
Your Step-by-Step Guide to thinkOnDemand
Getting started is straightforward. Here’s how to do it:
- Look for and click the OnDemand button in the top-right corner of your ThinkorSwim platform.
- You’ll be switched into a simulation that starts you with a virtual $100,000 paper trading account on historical data.
- Use the date and time controls to jump to any specific moment in market history you want to explore.
- Start trading as you normally would—place orders, set stop-losses, and manage your open positions.
- Use the fast-forward and rewind controls to speed through time or go back to review a key moment.
- Watch your portfolio’s value change in real time as the simulation moves forward.
Helpful Tips to Get the Most Out of It
To make your simulation run smoothly and be more useful, keep these practical points in mind:
- Set Your Clock Right: Always pick a time during regular market hours (9:30 AM – 4:00 PM ET). If you select a time when the market was closed, the price charts won’t update.
- Be Patient for Charts: When you jump to a new date or time, give it a few seconds for all the price charts to load and refresh completely.
- Know the Limits: Remember that Dynamic Watchlists and Scans don’t work in OnDemand mode. You’re working with static historical data.
- Keep a Journal: This is the most important tip. Write down each trade you make in the simulation—why you took it, how you managed it, and what happened. This record becomes incredibly valuable for spotting what works and what doesn’t in your strategy.
Method 3: Backtesting Your Own Trading Ideas with ThinkScript
If you've got a specific trading idea with clear rules, and you want to see how it would have played out over months or years of market data, this is the method you'll want to use. ThinkorSwim's Custom Strategy feature lets you build and test those ideas automatically, using their ThinkScript language. It runs your rules across every single candle on the chart and gives you a detailed report card. This is similar in concept to developing a strategy in Pine Script for TradingView, but with a different syntax and platform. For those looking to bridge the gap, our guide on how to convert Pine Script to ThinkScript offers a practical starting point.
How to Build and Run Your Custom Strategy Test
Think of this like setting up a science experiment for your trade idea. Here’s how to do it, step-by-step.
Phase 1: The Setup
- Pick a good chart to test on. Something with lots of history, like a 10-year daily chart of a major stock (AAPL works fine).
- Click on Studies → Edit Studies at the top of the chart window.
- Hit Add Study. To start simple, search for and select a pre-built strategy like MovAvgTwoLineStrat. This is just a common moving average crossover system we can use as an example.
- A settings window will pop up. You can configure the strategy's rules here. For our example, you might set it to use a 20-period and a 50-period Exponential Moving Average (EMA).
- Click OK. You'll immediately see arrows on your chart showing where the strategy would have entered long or short trades.
Pro Tip: Before you start tweaking things, go to Studies → Save Study Set and create a new set called something like My_Backtests. This saves all your work and keeps your testing indicators separate from the charts you use for actual trading.
Phase 2: Reading the Results 6. Now, right-click directly on the strategy's name (e.g., "MovAvgTwoLineStrat") on the chart itself and choose Show Report. 7. A new window opens with the full performance breakdown. This is where you get the real story. You can dig into a detailed trade-by-trade log, and see the key summary stats:
- Net Profit/Loss
- Total Number of Trades
- Win Rate
- Maximum Drawdown (the biggest peak-to-valley drop in your equity)
This report tells you if your idea has legs or if it's full of holes. The real power comes when you edit that pre-built strategy’s ThinkScript code to test your own, completely original entry and exit rules.
Getting Backtesting Right: How to Avoid Costly Mistakes
Backtesting is like a rehearsal for your trading strategy, but it’s surprisingly easy to get the script wrong. You can have all the right tools and still walk away with false confidence. Here are the most common slip-ups I see, and how you can sidestep them to build something truly robust.
Chasing Perfect Past Performance (Overfitting)
This is the biggest trap. It happens when you tweak your strategy’s rules so much that it fits every twist and turn of old data perfectly. The result? A strategy that’s brilliant in hindsight but falls apart in the real, unpredictable market. The fix is simple: test your idea across different chapters of market history—bull runs, bear slumps, and sideways grinds. If it can’t handle them all, it’s not ready.
Forgetting the Cost of Doing Business
In a simulation, your buy and sell orders fill at the perfect price. In reality, there’s slippage (the difference between expected and actual fill price) and commissions. Ignoring these is like budgeting for a vacation but forgetting the cost of meals. Always build in a small, realistic buffer for execution costs. It brings your results down to earth.
Trading with Monopoly Money
Using wildly oversized position sizes in a backtest makes profits look spectacular, but it doesn’t reflect the emotional or risk management reality of your actual account size. Test with the capital you really have, or plan to use. It keeps the performance metrics honest and tells you what to genuinely expect.
Only Practicing in Sunshine
If you only test a sailing strategy on calm, sunny days, you’ll be unprepared for a storm. Similarly, a strategy that works great in a strong, trending market might bleed money in a choppy, directionless one. The key is to seek out and test on different historical “seasons.” A strategy’s true strength is its ability to survive the bad times, not just capitalize on the good. For instance, incorporating a robust tool like the TTM Squeeze Pro Indicator can help identify low-volatility periods before major breakouts, adding another layer of market context to your tests.
Not Keeping a Record (The Silent Killer)
This might seem minor, but it’s critical. Without a simple trading journal for your backtest, you miss the story behind the numbers. Why did that losing streak happen? What did the winners have in common? Log each simulated trade—your reason for entering, your reason for exiting, and the outcome. Over time, these notes reveal priceless patterns in your own logic and the strategy’s behavior.
Making Sense of Your Backtest
Once your ThinkorSwim simulation is done, hit Show Report. You'll see a bunch of numbers, but don't let it overwhelm you. These are just the scorecards from your strategy's "practice games." Here’s how to read them, plain and simple.
| Metric | What It Tells You |
|---|---|
| Net Profit | The final tally. Did you end up in the green or the red after all those trades? |
| Win Rate | How often you were right. It's the percentage of trades that made money. |
| Average Win vs. Loss | The size of your wins compared to your losses. Winning big but less often can still work. |
| Max Drawdown | Your strategy's worst losing streak. It shows how much pain you'd have to sit through before things turned around. |
| Number of Trades | How many practice trades you took. You need enough to be sure the results aren't just luck. |
So, what’s a good result? Look for a solid net profit, a win rate you're comfortable with (or big average wins that make up for more frequent small losses), and a max drawdown that wouldn't keep you up at night. It's about finding a balance that works for you, not just hitting arbitrary numbers.
Q&A: How to Backtest on ThinkorSwim
Q: Is backtesting on ThinkorSwim free? Yes, it's completely free. If you have a ThinkorSwim account, you have access to all their backtesting tools — thinkBack, thinkOnDemand, and the Custom Strategies tester — with no extra fees or subscriptions.
Q: How far back can I backtest on ThinkorSwim? You get a lot of history to work with. For popular stocks and major indices, you can typically get daily chart data going back 10 to 20 years. This means you can test strategies across different bull markets, crashes, and everything in between.
Q: Can I backtest options strategies on ThinkorSwim? Yes, you can. The thinkBack tool is built for this. It lets you recreate complex options trades—like iron condors, strangles, or covered calls—using historical prices to see how they would have performed. It's one of the platform's strongest features for options traders.
Q: What is the difference between thinkBack and thinkOnDemand? This is a common question because they serve different purposes.
- thinkBack is like taking a snapshot. You pick a past date, place your trade, and then fast-forward to see your profit or loss on a future date. It's great for checking specific "what-if" scenarios quickly.
- thinkOnDemand is like a trading time machine. It rebuilds a full, interactive trading day from the past. You can watch the candles form in real-time (sped up) and place trades with a virtual account as if you were really there, which helps test your decision-making process.
Q: Can I backtest a strategy on multiple stocks at once? For the built-in tools, it's mostly a one-at-a-time process. You can build and test a Custom Strategy on a chart, but you'd need to apply it to each stock's chart individually. If you need to scan hundreds of symbols at once, you'd likely have to look into third-party tools that can connect to ThinkorSwim's data.
Q: Do I need to know coding to backtest on ThinkorSwim? Not at all for the main tools. thinkBack and thinkOnDemand are click-and-play—no code needed. Coding (using their ThinkScript language) only comes into play if you want to build a fully automated strategy from scratch. Even then, there's a huge library of pre-written strategies you can use or modify without starting from zero. If your strategy logic is already defined in Pine Script for TradingView, understanding If Else in Pine Script can help you translate those conditional rules into ThinkScript.
Ready to Start Your Backtesting Journey?
Now that you've seen how backtesting works on ThinkorSwim, here's a straightforward way to get your feet wet. Think of it as learning a new skill—you start simple and build from there.
- Hop into ThinkorSwim. Head straight to the
Analyzetab and open up the thinkBack feature. Just click around to get a feel for the controls. - Start with a familiar idea. Don't overcomplicate it. Try testing a basic strategy you already know, like a simple moving average crossover. Use the Custom Strategy tool on a 5-year daily chart of a stock you follow.
- Practice with real-time simulation. Turn on thinkOnDemand for a week's worth of old market data. Place trades in that simulated past moment. It’s the closest thing to a time machine for traders.
- Keep a simple log. Open a spreadsheet or a notebook. Jot down each simulated trade: what you bought or sold, why, and what happened. This record is gold for spotting patterns.
- Tweak and repeat. Check the performance report your backtest spits out. See where your strategy stumbled, adjust a parameter, and run it again. Refinement is the name of the game.
- Move to paper trading. Once your backtested results seem reliable, switch to ThinkorSwim's paperMoney mode. This lets you practice your strategy in real-time market conditions without real money, bridging the final gap before you trade live.
Successful trading isn't about hunches—it's about having a plan you've tested. ThinkorSwim puts all these tools in your hands for free. The trick is to not get overwhelmed. Pick one step, get comfortable with it, and then add the next. The clarity and confidence you'll build by doing this homework will pay off down the line.
Taking Your Strategy to the Next Level
Once you've mastered the basics of backtesting on ThinkorSwim, you might find yourself wanting to build and test more complex, proprietary indicators without learning to code. This is where a specialized tool can save you immense time and effort. For traders looking to create, optimize, and analyze custom strategies with professional-grade depth, platforms like Pineify offer a powerful suite of AI-powered tools.
Pineify allows you to visually build indicators or use an AI Coding Agent to generate error-free Pine Script code in minutes. You can then take your TradingView strategy and run it through Pineify's Professional Backtest Deep Report Analysis, which transforms basic CSV results into institutional-grade reports with metrics like Sharpe ratios, Monte Carlo simulations, and visual heatmaps. It's the logical next step for moving from simple validation to truly understanding and optimizing your strategy's edge.

