Thinkorswim Watchlist TTM Squeeze 54

Custom Watchlist Columns Colored to Match Dots on TTM Squeeze Centerline

Thinkorswim Watchlist TTM Squeeze

Thinkorswim Watchlist TTM Squeeze

This video shows how to add a column to any watchlist displaying red or green to show you which stocks are in a squeeze. Additionally, this code will count the number of green dots since the last squeeze ended. Zeros mean the stock is in a squeeze. Values greater than zero indicate a stock that has exited the squeeze and is potentially ready for a big move. You can sort the watchlist by this column so you can spot the stocks that have just recently exited the squeeze.

Be sure to watch the video so you understand how to install it. This indicator compliments a previous video we published that displays the colors of the TTM Squeeze histogram in a watchlist. Use these together to create a ‘radar screen’ similar to those used in TradeStation. In a single glance you can see stocks that are ready to make a move and which direction the indicator is predicting.

John Carter’s TTM Squeeze is a licensed study available free on the Thinkorswim platform. This code does not expose any source code as it is fully protected by the Thinkorswim platform.


*Thinkorswim is a chart analysis platform offered by TD

TD Ameritrade provides financial services including the trading of Stocks, Futures, Options and Forex.

Please be sure to share this page with your friends and colleagues. Leaving comments below is the best way to help make the content of this site even better.

input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def squeezeDots = TTM_Squeeze(price, length, nK, nBB, alertLine).SqueezeAlert;
def alertCount = if squeezeDots[1] == 0 and squeezeDots == 1 then 1 else if squeezeDots == 1 then alertCount[1] + 1 else 0;
plot data = alertCount;
data.AssignValueColor(if alertCount > 0 then Color.BLACK else Color.WHITE);
AssignBackgroundColor(if alertCount == 0 then Color.RED else Color.GREEN);


Watch the video, Thinkorswim Watchlist TTM Squeeze below:

__ Support our free content by making a purchase below. Thanks! __

Comments Drive Content of Future Posts:

54 thoughts on “Thinkorswim Watchlist TTM Squeeze

  • Jenny

    Thank you for all your amazing help Pete.

    I have an issue with a custom code I am writing up.

    def Buy = RSI < 30;
    def StrongBuy = RSI 70 ;
    def StrongSell = RSI >75;
    def NoBuy = not Buy and not StrongBuy and not Sell and not StrongSell;

    I know there are other ways around this. But really want to use the feature “not” due to some of my other code being alot more complicated and not as easy to code to not fall under 70 and above 30.

    Thank you.

  • Jesselle

    Thank you for the content Pete, its always appreciated.

    I put the squeeze dots on my watch list. I noticed that sometimes the watch list shows that the stock is in a squeeze and when the dots are green on the chart. I double checked the time on the chart with the time on the watch list indicator and it matches. Im thinking that the stock is squeezing but it hasn’t closed yet. Any idea?

    Thank you.

  • Jeff

    Hi Pete, setup the TTM Squeeze watchlist as indicated in your video but the horizontal red and green dots showing up as one thick continuous line.
    Any idea what went wrong in my setup?

    • Pete Hahn Post author

      “…horizontal red line…”. Yep, something is definitely wrong. Because this code is designed for a custom column in a watchlist. You tried to put this on a chart?

    • Pete Hahn Post author

      That’s going to happen from time to time and there is nothing you can do about it. The issue is on the servers that run Thinkorswim. We (the users of the platform) have no control over that.

      • John

        I figured it out. The symbol watchlist scripts don’t work on the TOS simulated trading platform, but they do work on the TOS live trading platform.

  • Rose M.

    Good Day Pete,
    I am trying to create a scan that will display multiple stocks and their TTM squeeze dot status on one screen, bottom area. For example, I want to watch for when Stock1, Stock2, and Stock3 are in a squeeze. I would like it displayed on the chart instead of a watchlist. This way, one chart shows this indicator for those selections.
    Thanks TONS!

  • Todd McCutcheon

    Thanks for the video. Looking to change time frame – on Custom Quote Formula. I see how to change to a standard Time Frame (daily, 1 minute, 5 minute, etc.). In Time Frame setup I have established my favorite time frames – such as 195 minutes. What would I need to change in your setup to be able to use a column in the watchlist for the squeeze on a 195 minute frame. Thanks. Todd

    • Pete Hahn Post author

      “Fixed”? Nothing is broken, that is the intention. According to John Carter the number of red dots do not matter. Therefore the code does not count them. You are welcome to post a request in the Q&A forum asking for a modification. Be sure to search the forum first to make sure someone has not already requested this.

  • Corey

    Hello Hahn. Is there a code that will also add the TTM wave color and TTM trend indicator colors to my watchlist? If the TTM wave is positive the color would reflect as blue if negative red. If the TTM trend is positive the color would reflect as blue and if negative red.

  • RJ Andersen

    Thanks for all of the great content Pete. I have my watchlist setup with D_Sqz and W_Sqz but having trouble finding the coding for the daily and weekly direction change. Where can I find the direction color code?

    • Pete Hahn Post author

      By “direction change” do you mean the watchlist that changes color to match the colors of the histogram of the TTM Squeeze? Did you check the green menu on the left sidebar at the top of this very page?

  • Paul Botelho

    Thanks for this. This is very helpful. Is it possible to make one for TTM Trend also? Would love to have one for the Squeeze and the trend. Thanks

  • Carol Pfarr

    Is it possible to create a scan for when ADX is at the top of the range with DMI- and the existing stoch/macd scan? I like to find the lowest price action and ADX is at the top, DMI- is with it and then we get the stoch/macd ‘spike’ and the price moves up. Is it possible to combine that into one scan?

    • Pete Hahn Post author

      Sounds like it’s possible. You will need to post this in the Q&A forum and provide a screenshot showing at least one of these signals you want the scan to pickup. Make sure the screenshot shows the entire chart so we can replicate it our platform. The title of the question should be 6-8 words and clearly describe the context of your request. Avoid meaningless phrases in the title such as “How to”. The question title should be very similar to what you would used to search for this solution. Have you searched yet?

  • Kevin JGreehey

    Pete, thanks for the scans I did weekly and daily but I would like to do 4 hour and 1 hour but it doesn’t come out right. Is there something I ned to change? Thanks for all your help!

  • Nancy

    Hi. I have created the watchlist for the Daily and Weekly. But all they show are red and green…….no light blue, dark blue or yellow. Can you tell me if there’s addition code that needs added for those?

  • Jordan

    Hello, great video! I’m having an issue though, I copied the code but the watch list just says “loading”. Can you please tell me what I did wrong?

  • siva vinta

    TTM squeeze dots, it is showing only for green dots and number of green dots. For red dots, it is not showing number or red dots (always shows zero). Please post this if it requires programming change?

  • Hilario Dsouza

    Hi Pete, On the TTM squeeze I wanted to setup a trigger (Plot) on the COLOR of the BAR. For Example if the COLOR is LIGHT BLUE or YELLOW then setup an alert. I see you did something similar in the video above. I am planning to use the color of the bar along with the MACD and stochastic indicator. I wrote the initial lines of code, but I am not sure how to get to the Yellow Bars.
    input price = CLOSE;
    input length = 20;
    input nK = 1.5;
    input nBB = 2.0;
    input alertLine = 1.0;

    def yellowbar = TTM_Squeeze(price, length, nK, nBB, alertLine).SqueezeAlert;