If you’re just starting out, be sure to visit the thinkorswim Learning Center first. The video on that page describes how to get started with creating your first scan. I’ll keep this simple, and even provide the code for you! In this scan we will meet the following criteria. 1) The stock must have gained at least one dollar from the previous day’s close during the pre-market trading session. The pre-market is defined as the time between 4:00am and 9:29am. 2) The pre-market cumulative volume must exceed 5,000 shares traded. Here are the steps to create a thinkorswim (TOS) dollar gainer scan. Feel free to update the change and preMktVolMin variables to meet your needs.
- For the “Scan in:” section, choose All Stocks from the Category list
- For the “Exclude:” section, choose All OTC Stocks from the Category list (unless you like to trade OTC stocks, of course)
- Add a filter using the “+ Add filter” button. Choose Stock. Under the first drop-down, choose Last and set the min and max price for the stocks you like to trade
- Add another filter. This time choose Study. At the bottom of the first drop-down list, choose custom. A window will open. Click the “thinkScript Editor” tab at the top of the window. Also, change the Aggregation (also at the top of the window) to 1 min. Remove the default code from the editor window and copy/paste the code from below. Update the “change” or “preMktVolMin” variable values as needed.
- Add another “Stock” filter. Set it to a Market cap min. of 1M. This will filter out some things that are not stocks.
def change = 1.00;
def preMktVolMin = 50000;
def mktClose = 1559;
def preMktStart = 0400;
def preMktEnd = 0929;
rec closePrice = CompoundValue(1, if SecondsTillTime(mktClose) == 0 then close else closePrice, close);
def gainers = (close - closePrice) >= change;
def preMkt = SecondsFromTime(preMktStart) >= 0 and SecondsTillTime(preMktEnd) >= 0;
def preMktVol = if preMkt and !preMkt then volume else if preMkt then preMktVol + volume else preMktVol;
plot scan = preMkt and gainers and preMktVol > preMktVolMin;
- Click OK to exit the window.
- Click the menu to the far right of the “Add condition group” button, and click “Save scan query…”
- Give your scan a name, and save it.
- Click the Scan button and await your results! NOTE: If you’re not scanning during the pre-market, you’ll get no results.
Once you’ve installed the Position Size Calculator for thinkorswim you may be asking yourself how to actually view the calculations. Some thinkScripts overlay things on your charts, but this particular script adds calculations to the data box. In this post, I’ll describe how you can enable to floating data box so you may easily view the position size calculations. Before you proceed, be sure that the indicator is installed in one of the “lower” positons of the edit studies area. Placing it on the “Price” or “Volume” area will smush the candles on the chart.
Data Box is a tool that displays values from the status string on chart. Once enabled, Data Box displays OHLC and study values for the bar under the cursor. As you move the cursor across the chart, values change in the same manner as in the status string.
In order to enable Data Box, choose Settings from the Style menu and activate Data Box item on the General tab. Choose Floating to make the Data Box follow the cursor or Fixed to display it as a separate element. Choose Off so that the Data Box will not be shown. You can also turn off the status string since the values are displayed in Data Box.
If you chose to use the Fixed mode, Data Box will appear as a separate element: you can move it to whichever position you prefer. This mode will also restore this position if you restart the application. There is also an option to display it above all opened windows so that it will be visible even if you minimize the application window; in order to do so, click the Pin button at the top of the Data box. Note that if you use a grid of charts, Fixed mode will show values for the chart under cursor.
In the Floating mode, Data Box will follow the cursor, so, the list of displayed values is not customizable. Consider using the Synchronize crosshairs position option on General tab of Chart settings in order to display separate Data Boxes for each chart in a grid. Note that in the Floating mode, Data Box will be hidden if the size of chart window is not sufficient to display it.TD Ameritrade Learning Center
I have to say, I’m a big fan of the floating mode. It allows me to place the data box on another screen so it doesn’t interfere with my charts and other account information that I like to leave up. Also, when it’s in fixed mode, there’s very little data you can actually see if you’re screen isn’t super wide, so for me it’s practically useless in that mode.