tos_rtd

Listen to real-time data feed from ThinkOrSwim using Node JS and Excel

Only works with Windows operating systems due to limitations with ThinkOrSwim.

Setup

  1. Launch ThinkOrSwim and log in.
  2. Open "MarketWatch" tab and customize a data set.
    1. Click the tiny settings icon in the right most column then click "Customize".
  3. Click the "Show actions menu" button (list icon) in the top right.
  4. Hover over "Export" and click "To Microsoft Excel".
    1. The current watchlist, formatted for Excel, is copied to the clipboard.
  5. Open "tos-rtd.xlsm" from the tos_rtd repository.
  6. Either paste directly into the Excel document or into "scanner.csv" and save the file.
    1. The Excel script is written to "pick up" the changes made to scanner.csv every minute.
  7. Using a terminal app like Command Prompt navigate to the tos_rtd directory and run "node listen.js".

Once a watchlist has been configured, only step #1, #5, and #7 are needed. To edit a watchlist, all steps are required.

How it works

Excel acts as a middle man between ThinkOrSwim and Node JS by importing data from TOS and exporting for use with Node.

  • ThinkOrSwim creates a new RTD server instance for use with RTD client applications like Microsoft Excel.
  • Once the RTD connection has been established, an Excel script (VBA) runs in the background to listen for changes to the Excel document.
  • If a change is detected, that row of data is exported to a file in the tos_rtd directory in a querystring format:
?Symbol=AAL&Last=45.83&Bid=45.82&Ask=45.84
  • The Node JS script "listen.js" uses a built-in function to listen for changes in the "data-stream" directory and parses the contents of the changed file.

Made by Jason, Chris and Shawn

© 2020 Builtneat, Inc. All rights reserved.