Backtesting with thinkorswim® OnDemand

August 28, 2023 Advanced
Backtesting trading strategies can provide traders with potential insights for future trades. Here's how traders can use thinkorswim® OnDemand to analyze potential profit and risk.

One way to test strategies is through the process of backtesting. Backtesting allows a trader to see how a specific strategy would've played out based on historical data. After analyzing the results of the strategy, backtesting can provide information that may be helpful in implementing the trading strategy in real time. While there's no guarantee that a trader will see similar results in the future, backtesting can be a useful strategy. Here's how to use thinkorswim® OnDemand to backtest trading strategies.

What's available with OnDemand

When using thinkorswim OnDemand, traders have access to the following features:

  • Run the backtesting software platform anytime of the day, including nights and weekends.
  • Watch tick-by-tick price changes for stocks, futures, forex, and options.
  • Simulate trading 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 fast-forward to another date.
  • Find historical data dating as far back as December 6, 2009.

Both short-term and long-term investors can use backtesting to evaluate a strategy.

For example, a short-term trader might review how specific strategies would've played out during market-moving events like Fed announcements and earnings reports.

A long-term investor can potentially see how a simulated portfolio would've performed when the overall market was bullish, bearish, or neutral, as well as how world events and macroeconomic news would've affected their profit and loss.

When using OnDemand for backtesting, though, it's important to understand 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 the live trading screen on the thinkorswim platform. To open it, select the OnDemand icon in the upper right of your platform (see below).

Image shows where to find OnDemand after logging in to thinkorswim.

Source: thinkorswim platform

Traders can verify they're using OnDemand and not trading with live money by reviewing the following items:

  • A pop-up thinkOnDemand enabled window gives an overview of OnDemand's capabilities.
  • The OnDemand button is shaded orange and a calendar appears next to it.
  • The entire platform has an orange border around it.

After verifying they've correctly launched OnDemand, traders can select the green OK button.

OnDemand simulated environment

Image demonstrates how the thinkorswim platform appears after selecting OnDemand

Source: thinkorswim platform

When using OnDemand, the Account Info section in the upper left is set to $100,000 by default with a note below indicating "These are simulated values." 

To simulate a trading strategy, select the calendar and set the date and time to any point from December 2009 forward. Traders can then place trades as normal. The Order Confirmation window will indicate that each is an OnDemand Virtual Order. It's possible to pause the tick data or fast-forward to another date and time to see how profit and loss would be impacted.

After placing a number of simulated trades and backtesting some strategies, a trader might want to tweak their trades to see if they could've performed better. To make changes to the simulated trades, a trader can select the reset icon—the circular arrow to the right of Account Info—to erase their virtual trades and reset the account value back to $100,000.
To resume live trading, select the orange OnDemand button to return to the live thinkorswim platform.

The information provided here is for general informational purposes only and should not be considered an individualized recommendation or personalized investment advice. The investment strategies mentioned here may not be suitable for everyone. Each investor needs to review an investment strategy for his or her own particular situation before making any investment decision.

All expressions of opinion are subject to change without notice in reaction to shifting market conditions. Data contained herein from third-party providers is obtained from what are considered reliable sources. However, its accuracy, completeness, or reliability cannot be guaranteed.

Examples provided are for illustrative purposes only and not intended to be reflective of results you can expect to achieve.

0723-3WR7