Thinkorswim TTM Squeeze Watchlist 63

Custom Watchlist Columns Based on the TTM Squeeze Histogram

Thinkorswim TTM Squeeze Watchlist

Thinkorswim TTM Squeeze Watchlist

With this tool, just a quick glance is all it takes to see which stocks are trending. This video shows you how to display the TTM Squeeze histogram colors in a custom watchlist column. Add multiple columns to the watchlist, each referencing a different time frame. Easily see which stocks have the TTM Squeeze direction aligned across multiple time frames. Free custom code is included below. Just follow instructions in the video to copy/paste this code and create your very own custom watchlist columns.

No source code is disclosed as the Thinkorswim platform provides access to the plots while keeping the proprietary code out of sight.


*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.

Here is the code used to create your own custom watchlist columns as demonstrated in the video below.
input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def squeezeHistogram = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram;
plot hist = if squeezeHistogram>= 0 then
if squeezeHistogram> squeezeHistogram[1] then 2 else 1
else if squeezeHistogram < squeezeHistogram[1] then -2 else -1; assignBackgroundColor(if squeezeHistogram >= 0 then
if squeezeHistogram > squeezeHistogram[1] then color.CYAN else color.BLUE
else if squeezeHistogram < squeezeHistogram[1] then color.RED else color.YELLOW); hist.assignvaluecolor(if squeezeHistogram >= 0 then
if squeezeHistogram > squeezeHistogram[1] then color.CYAN else color.BLUE
else if squeezeHistogram < squeezeHistogram[1] then color.RED else color.YELLOW);

Watch the video, Thinkorswim TTM Squeeze Watchlist below:

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

Questions? Comments? Post a review?

63 thoughts on “Thinkorswim TTM Squeeze Watchlist

  • BMartin1776

    Any idea why the this wouldnt update in the watchlist?

    I scalp, so I have mine setup for 5 min and 1 min squeeze (with color columns from the earlier vid you provided) BUT today I had one stock that was in a squeeze for well over 30mins via a 5 min chart that was not showing up red on this, and same at the 1 min

    I had to go into the edit feature and simply save them again making NO changes at all to the code for them to display the correct status of the stock I was watching.

    • Pete Hahn Post author

      Sorry but I really have no idea why that would happen under normal operation. I have seen it take 3-5 minutes for custom columns to updated under normal circumstances. And I have seen much longer delays when they were having problems. But I haven’t seen any problems in the last several weeks. I suggest you contact TD Ameritrade support if this continues.

  • npatel216

    Is there a way to make this indicator work during market hours? I have built a dashboard and used your code for the watchlist as well. the problem i am running into is all the columns keep saying loading during market hours and only work when the market is closed.

    Any suggestions would help…

    And i love what you are doing learned a lot from your videos, thank you so much.

    • Pete Hahn Post author

      Thinkorswim is currently having a problem with this feature on their platform. They refer to this feature as “Custom quote fields”. I tried to notify them a couple weeks ago but they deny there is an issue. We need every Thinkorswim user to report this issue or they will never acknowledge it and fix it. The following post in our Q&A Forum was the first time I became aware of the issue:
      Please pass this along to everyone you know and suggest they submit their own support ticket to TD Ameritrade Support.

  • Ellis

    Hello Pete

    Love the TTM Squeeze Watch-list

    Could you write one more piece of code to attach to it that would show the bar trend count across all 4 colors?

    • Pete Hahn Post author

      No this does not work with the Squeeze Pro. That would require an entirely new solution and you would need to purchase the Squeeze Pro indicator in order to get the source code. Then pay someone to modify the Squeeze Pro to work in a watchlist column.

  • Chuck

    Tried copying and pasting the code and it has errors on very line…. I got most of it fixed on my mac by placing my curser before the error and hitting delete. But when it gets to the plot line. I cant fix the code, so I can’t make it work. Any suggestions?

    • Pete Hahn Post author

      Sorry I have no suggestions at all. If you copy and paste the code into a custom watchlist column it does not produce any errors at all. I believe you have grabbed the wrong code or you are trying to apply it to the wrong tool on Thinkorswim. Did you take the time to watch the video? Everything was explained there.

  • Robert K

    I’m been trying to figure out how to write a similar code for adding a color coded column to display the current TTM_Trend status to the Watchlist (Blue for Uptrend and Red for Downtrend just like on the chart), but I don’t know anything about coding.

    Any chance you can help??

  • Jin

    Hi Pete, on the other video I forgot which video was it, The code is:
    plot data = TTM_Wave().Wave1;
    AssignBackgroundColor(if data > 0 then Color.GREEN else if data < 0 then Color.RED else Color.CURRENT);

    Which TTM will show Green or Red. Example Weekly Chart for TSLA it showing RED and -37.12 but how come on the TTM Squeeze it showing -2119.9?

    Thank you

      • Jin

        I also have TTM Squeeze on my watchlist with colors matches but it showing either 1.0, 0, 2.0 is a possible way to change the number that matches to TTM Squeeze showing under the chart?

      • Pete Hahn Post author

        It already matches. As I demonstrated in the video. The only time it would not match is when you chart settings do not match the settings of the custom watchlist column.

  • Rick Wrightson

    Peter, when I did the copy/paste into TOS (following your excellent and precise instructions), I get three errors.
    Invalid statement: plot at 9:1
    Invalid statement: assignBackgroundC… at 13:1
    Invalid statement: hist at 17:1
    Are “plot’; “assisgnBackgroundColor”‘ “hist” all missing from the TOS library?

  • Howa Young

    This color coding on watchlist is very useful. Can you also provide coding for MACD Histogram colors like you did for TTM Histogram? I tried to code it for MACD histogram without success. I am willing to pay for this service. Note: i have bought your volume profile in 2018, which I don’t use much because I don’t understand it. But this TTM histogram column color is very useful. It is better if you can have the same for MACD histogram.

  • Dan

    Brilliant Thank you ! I wanted to use this for day trading Momentum stocks. Do you think a daily/60m/5m/1m would be the best timeframes ? Looking to have a Watchlist created form a scan that identifies sacking moving into “Blue Territory”

    • Dan

      typos! .. should read “a watchlist created from a scan that identifies stocks moving into “Blue ” territory ” over a given set of timeframes

    • Pete Hahn Post author

      I have absolutely no opinion on what settings work best. I do not teach people to trade. I build tools to help traders get the information they need more efficiently.

  • Michelle

    How can I set up my TOS platform to show the charts the way you have them? That workspace looks like it is very productive in that it shows the main time frames all in one glance.

  • Alexander Barhatkov

    also this basic function or

    close is less than or equal to ParabolicSAR()

    assignbackgroundColor(if Scan >=1 then color.BLUE else color.BLACK);

    this is not working for me
    how do i tell it to change color if the close is below or above standard parabolic SAR

  • Alexander Barhatkov

    Pete hi. Can please u help me fix this custom Stochastic fast watch list function

    input price = CLOSE;
    input length = 20;
    input nK = 1.5;
    input nBB = 2.0;
    input alertLine = 1.0;
    def stochasticFast = ( nK, nBB, ).stochasticFast;
    plot stochasticFast = if stochasticFast>= 0 then
    if stochasticFast> stochasticFast[1] then 2 else 1
    else if stochasticFast = 0 then if stochasticFast > stochasticFast[1] then Color.CYAN else Color.BLUE else if stochasticFast = 0 then
    if stochasticFast > stochasticFast[1] then color.CYAN else color.BLUE
    else if stochasticFast < stochasticFast[1] then color.RED else color.YELLOW);

  • Kevin

    Hey Pete, great video. I followed it to the T and all the boxes on the wk,day and hour are all white. Did I do something wrong. I’m new to all of this. Thanks

  • cam

    I’m trying to get the color of the histogram from the 5 min chart but use it on a 1 min chart. I tried changing the aggregation period of CLOSE to 5 min, however it ignores this and only outputs the color of the histogram from the 1 min. Do you think there’s any way around this?

  • HD Patton

    I’ve loaded the ttm dot squeeze on to my watch list, I cant figure out how to make it count the red dot on a one min chart.

  • Srini

    Thanks for your prompt response. Will the color codes be accurate if the aggregation on the chart is 180 days and 195 minutes. I want to use this for options and hence the longer time frame. Since there is no way I can extend the time frame on the colors they may not be in sync. Thanks, Srini

      • vanna

        Pete it works fine on my end as well initially, but on occasion as the day progresses black box with “NAN” show up. I use this to watch the 5, 15,30m time frame for squeezes…what your email..I can send you a screen shot

      • Pete Hahn Post author

        There is nothing in the code that can cause this. If/when it occurs this is entirely a problem created within the platform. This cannot be addressed by changing the code.

  • Srini

    I have Extended Hours ticked for Futures, while I do not have the same for Equities. Can I then use separate sets of columns in 2 different watchlists? When I change the Watchlist, will the right set of TTM Sqz colors come up?

      • Srini

        Thanks for your response. Are the columns then saved as part of a watchlist i.e when I switch between watchlists, will the columns settings for TTM sqz be appropriately selected?

        Thanks, Jagdish

      • Pete Hahn Post author

        There is no way to save the columns of a watclist. You can only save the contents. The Ticker symbols themselves.

    • Srini

      Hi Hahn,
      Just a query on the color code for TTM Squeeze. Can I change the code to use this for 6 months or 180 days and 195 minutes aggregation. Appreciate your response. Thanks, Srini

      • Pete Hahn Post author

        The only aggregation periods supported are the ones you can select at the top of the code editor. The code has absolutely no impact on the aggregation period.

  • louis

    High Peter, I got the TTM watch list copied to my TOS platform. The weekly and daily color shade of the histogram bar are accurate, the hourly is not? any advice to rectify? Kind regards~Louis

  • Srini

    Great Video and presentation Hahn. You have given examples for stocks. Can this be TTM squeeze color coding be used for a futures watchlist as well – YM / RTY etc. Also, when I use this for futures, for some periods there is a display of NaN. What does this mean or signify?

    • Pete Hahn Post author

      The code should plot colors for futures just as it does for stocks. If you are getting NaN instead of a color, this is due to some processing error in the platform. NaN means “Not A Number”. Which happens when the platform cannot compute a value. This most often occurs while markets are close, or during periods of extremely high market activity.

  • siva vinta

    can I get color of histogram and associated number in the table? I can see the number only if I highlight the particular stock. But i would like to see color and number associated with it at the same time