One question I am asked often is how to use the Stock Hacker in TOS to scan for the TTM Squeeze. Though there is a built in scan for the Squeeze, it is limited in both its capabilities and the time frame one can use it on. Fortunately, with a little clever thinkScript we can leverage the built in TTM Squeeze indicator in a variety of useful ways.

Lets start with a basic scan for stocks currently in a squeeze on any given time frame. First, you will need to go to the thinkorswim Scan tab and open the Stock Hacker. By default, there are several scan parameters already pre-configured that you may want to remove by clicking the x at the far right.

thinkorswim squeeze scan setup

The next step is to click the button for “Add study filter” as shown below. There you will see ADXCrossover. Click the dropdown and select “CUSTOM”. This will bring up the Scanner Custom Filter dialog. Select the thinkScript editor tab and delete the ADXCrossover code from the window. Type “TTM_Squeeze().SqueezeAlert == 0” into the script editor. Lastly, choose your desired aggregation period for the scan. The daily interval is shown below. When complete, click OK.

thinkscript editor

Once you click OK you can then choose a watchlist and run the scan. The resulting list will include all tickers currently in a Squeeze.

Continuing in the same basic manner, we can also scan for stocks which have just entered a Squeeze. If you click the pencil icon you can edit the custom thinkScript scan code. To look for a ticker just entering a Squeeze we need to add in the condition to our prior code that specifies the lack of a Squeeze on the prior bar. Add “and TTM_Squeeze().SqueezeAlert[1] == 1” as shown below.

Scanner Custom Filter

Again, click OK and run your scan. Your results will include all tickers one dot into a Squeeze.

The logical next step is to scan for stocks just exiting a Squeeze (i.e. the Squeeze has “Fired”). By simply reversing the 0 and 1 as shown below, we can create this scan.

Squeeze Fired

Lastly, we can use our first scan for stocks in a Squeeze multiple times within the Stock hacker but with different time frames. This ends up being a scan for a multiple time frame Squeeze. Here’s how it looks when completed:

TOS custom squeeze scan complete

That’s all the basic tools you’ll need to construct just about any type of Squeeze scan you can conjure up. Happy scanning!