Skip to content

bzeitner/TOS-Auto-Export

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOS Auto Export

This program allows you to auto export strategy reports from the TDAmeritrades Thinkorswim desktop platform.

Getting Started

This program has only been tested on Windows OS.

You will need the Thinkorswim desktop application, for the program is created for this application specifically. The program uses pyautogui to automate native keyboard and mouse functionalities.

Prerequisites

Virtual Env: Pipenv [OPTIONAL]

Dependencies: pyautogui, playsound, keyboard

Desktop App: TDAmeritrades Thinkorswim

Language: Python 3.8+

First thing we need to do is setup the Thinkorswim app.

  1. Go into your thinkscript editor for the strategy of your choice and plot a SMA or anything that will plot a line, and multiply it by 2 or more. (See image below)
  2. Once entered, apply and save.

Alt text

  1. Once back at the main screen, go to your chart where you are displaying the strategy that you just added the SMA line to. Notice how high it is above the actual candles. Thats what we want. (See image below)

Alt text

  1. Next, double click on the SMA line, and a customizing popup will display. Click on the plots dropdown, then click on the SMA tab. The image below is what should be displayed.

Alt text

  1. Next, we need to change the draw as display, which changes how the plot is shown on the chart.
  2. We need to change this to a bar graph that covers the entire chart. (See image below)

Alt text

  1. Click apply, and save.
  2. You should now have something like the image below.

Alt text

Getting coordinates for key locations based on your screen size

  • There are key locations that you must obtain so the program knows where to send the cursor.

  • The images below will show the the locations.

  • There are two types of coordinates you will need. Relative and Absolute.

    1. Relative - x, y coordinates are relative to where your mouse cursor currently is located.
    2. Absolute - x, y coordinates are not relative to your mouse cursor and will go to the precise screen location specified.
  • All of these coordinates will need to be set in accordance to where they are needed in the program. The program has comments throughout to help you locate theses areas.

  1. First, you will need the absolute coordinates for the watchlist dropdown hamburger icon and relative coordinates for the Export to file... [Hamburger icon > Export to file... tab]

Alt text

  1. In the file explorer that pops up after you click the Export to file..., get the relative coordinates for the save button. Make sure you change the directory to your working directory before saving. This will set the working directory as the default so you don't have to change it everytime.

Alt text

  1. After that, you need the the absolute coordinates for the top most symbol in your watchlist. Always make sure that your watchlist is scrolled all the way to the top before you run the program, or you won't export all the files in the watchlist.

Alt text

  1. Next, you will need absolute coordinates to any location within the red box below.

Alt text

  1. This dropdown propegates when you right click on the chart only where the SMA graph is covering the chart. You will need the relative coordinates for the Show report tab.

Alt text

  1. You will need the relative coordinates for the Export File button. [Show report tab > Export File button]

Alt text

  1. You will need the relative coordinates for the Save button. All files will be downloaded to your documents folder by default. The program will automatically move each file from there to your csv_files directory in your working folder. [Export File button > Save button]

Alt text

  1. Next, we need the relative coordinates for the Close button. [Save button > Close Button]

Alt text

  1. Once closed, the program will automatically arrow down to the next symbol in the watchlist.

Alt text

  1. This process will continue until it reaches the final symbol in the watchlist.

  2. Upon completion, an alert will sound letting you know that the program has finished. That way you can be away from your computer and you will hear when it's complete.

What if theres an error?

  • Well, the program can handle that. Just restart the program, and make sure that the watchlist is all the way to the top, and the program will automatically scroll down to where the program left off.

  • If there is an error, an alert sound will trigger, all remaining strategy reports located in the users documents folder will be deleted, and the error message will display in your terminal.

  • Most common error is when there is a missed export, due to either the user moving the mouse or Thinkorswim not loading charts fast enough, or not at all.

Video below shows the program in action.

TOS Auto Export Demo

About

Automated exporter for strategy reports for Thinkorswim Desktop App.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%