How to Export and Process ThinkorSwim Backtesting Data


2019 Donor
I wanted to share with everyone how I have attempted to tackle the abysmal backtesting platform in ThinkorSwim using Excel.

You will need some pre-requisites to get started
  1. Notepad++: I use this tool for removing the commas from the thousands separator in the P/L column. It is also great for handling multiple files all at once.
  2. Excel: I was going to do this with Google sheets but it became more of a burden and I lost interest
  3. File Repository:
The video below will take you through all the steps to utilize the backtest sheets properly. If you don't have time for the video the instructions are in the file repository and the Backtest template, Ill also paste them below the video.

Backtesting How-To

Open the Backtest DB ( here you can store the results of all your backtests it also stores the macro you will use to normalize the think or swim backtest CSV's)

Exporting your Strategy Backtest

  1. Run a backtest
  2. Right-click on a signal of your backtest
  3. Select show report
  4. Click export file
  5. Save the file to your computer
On your computer
  1. Rightclick on the CSV file you saved and select open with Notepad++
  2. Hit ctrl+F to open the find window
  3. Select replace
  4. In the find what dialog box add a comma (we want to remove all the extra commas)
  5. Select replace all in all open documents
  6. Select save
  7. Close notepad++
Open the BackTestTemplate_Equities.xlsx file and minimize

Open your backtest file from TOS
  1. All the data is in column A so we will use the Macro from the DB sheet to scrub
  2. Use ctrl+f the macro in the database excel file will expand all the relevant columns
  3. Now you can copy and paste the columns into the Raw data column in the template
  4. Copy your data in the Raw Data tab
Select the raw sort tab
  1. Paste your data in the RawSort tab
  2. Sort the data on the Date/Time Tab
Select the stats tab to pull out the relevant stats for your strategy. The Results tab also has some relevant charts for P/L Distribution and your P/L Curve
Last edited by a moderator:


Well-known member
As @Zachc noted above, ALWAYS use Notepad++ for storing Thinkscript as well. Never WORD or other word processor. Thanks, Zachc!

Similar threads