Get The Ticker Tape delivered right to your inbox.


Backtesting with thinkOnDemand to Help Optimize Your Trading

February 16, 2018
Rewind: thinkOnDemand helps you backtest your trading strategy with historical data
Getty Images

How great would it be if you could go back in time and learn from your past mistakes? Maybe you would have taken that job offer, married your high school sweetheart, or passed on drinking that expired milk?

Of course, reliving the past is just a fantasy, right? Well, not with thinkorswim OnDemand, a powerful stock backtesting tool available on the TD Ameritrade thinkorswim trading platform. It lets you replay past trading days to evaluate your trading skill with historical data.

That’s right. The tool has recorded virtually each market tick, so you can backtest stock, forex, futures—you can even backtest options trading strategies—all the way back to December 2009. You can even see Level II quotes (essentially the NASDAQ order book). It’s all waiting for you in OnDemand.

What Can You Do with OnDemand?

  • Run the backtesting software platform 24/7, including nights and weekends
  • Watch tick-by-tick price changes for stocks, futures, forex, and options
  • Simulate trading just as you would in a live trading account, except with historical rather than real-time data
  • Watch the profit or loss of simulated positions as the “trading day” proceeds, or as you fast-forward to another date
  • Find historical data as far back as December 6, 2009

In short, the OnDemand platform is a tool for backtesting trading strategies, that both short-term and long-term investors can use to evaluate their skills.

For example, if you are a day trader, you can see how your strategies would have held up during market-moving events like Fed announcements, earnings reports, or even the “Flash Crash”—which occurred intraday.

For those with a longer-term investment approach, you can see how a simulated portfolio would have performed when the overall market was bullish, bearish, or neutral, as well as how world events and macroeconomic news would have affected your profit and loss.

Just keep in mind that results are hypothetical, and there is no guarantee the same strategy implemented today would yield the same results.

How to Use OnDemand

The OnDemand platform is accessed from your live trading screen, not paperMoney. So, log on to thinkorswim as you normally would. When you are ready to start OnDemand, click the button in the upper right-hand corner of your platform (figure 1). 

Backtest trading with thinkorswim OnDemand


First, click the “OnDemand” icon, found in the upper right-hand corner. Image source: The thinkorswim® platform from TD Ameritrade. For illustrative purposes only. Past performance does not guarantee future results.

You’ll notice a few changes that indicate you are not trading live money (figure 2).

  • A pop-up window gives an overview of OnDemand’s capabilities
  • The “OnDemand” button will be shaded orange and a calendar will appear next to it
  • The entire platform will have an orange border around it

Your “Account Info” section in the upper left-hand corner will be set to $100,000, with a note below it indicating “These are simulated values.” Now you can click the calendar and set the date and time to any point from December 2009 forward. Once you’ve done that, you can place trades as you normally would; your order confirmation window will indicate that each is an “OnDemand Virtual Order.” You can let the tick data run and pause it whenever you want, or fast-forward to another date/time to see how your profit and loss is affected.

Backtest trading with thinkorswim OnDemand


Once your account moves into backtesting mode, you can select the date and time and trade a simulated $100,000 account. Image source: The thinkorswim® platform from TD Ameritrade. For illustrative purposes only. Past performance does not guarantee future results.

Let’s say you’ve placed a number of trades and tried out some backtesting strategies, but want to tweak them to see if they could have performed better. Simply click the “reset” icon—the circular arrow next to “Account Info”—to erase all your virtual trades and reset your account value back to $100,000.

When you have finished backtesting and are ready to resume live trading, simply click the orange “OnDemand” button again and your platform will take you back to the present.

TD Ameritrade Network

Access live and on-demand programming from our media affiliate, TD Ameritrade Network, which can be accessed via the thinkorswim® platform, Mobile Trader app, or on the TD Ameritrade Network page.

Scroll to Top