Custom Watchlist Columns Based on the TTM Squeeze Histogram
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.
Learn More:
Click and drag interface to build custom watchlist columns. No code experience required:
Thinkorswim Condition Wizard Watchlist
DISCLAIMER: I AM NOT A CERTIFIED FINANCIAL ADVISOR AND NOTHING IN THIS VIDEO OR TEXT IS AN ADVERTISEMENT OR RECOMMENDATION TO BUY OR SELL ANY FINANCIAL INSTRUMENT. NOR IS THIS VIDEO OR TEXT INTENDED TO INSTRUCT YOU ON HOW TO MAKE BUY OR SELL DECISIONS USING ANY OF THESE INDICATORS.
*Thinkorswim is a chart analysis platform offered by TD Ameritrade: www.tdameritrade.com
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);
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.
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: https://www.hahn-tech.com/ans/delay-calculations-so-the-watchlist-can-update/
Please pass this along to everyone you know and suggest they submit their own support ticket to TD Ameritrade Support.
I have no requests but simply an acknowledgment for your excellent work. I donated to your website.
Hi Susan, thanks so much for your voluntary contribution and thanks for taking the time to express your appreciate for our free content.
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?
That would be a very complex modification. Well beyond the scope of what I can cover in the comments section of a video.
Does this code work with the newest version of the squeeze indicator the Squeeze Pro? If so, does it need to be modified?
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.
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?
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.
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??
Did you try searching our Q&A forum? https://www.hahn-tech.com/ans/could-a-custom-color-code-column-be-made-for-the-ttm-trend/
Just found the forum and was typing a reply as you write this. Much appreciated!!
Wait, nevermind. Found your message board which had the answer 🙂
input compBars = 6;
input paintBars = yes;
plot upTrend = TTM_Trend(compBars, paintBars).TrendUp;
AssignBackgroundColor(if upTrend then Color.BLUE else Color.RED);
THANKS!!!
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
The section of code you gave is for the TTM_Wave and NOT for the TTM_Squeeze. That’s why the don’t match.
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?
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.
Thank you, I will rewatch the video again.
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?
When I copy/paste the code I get no such errors. No errors at all. For the record, there are only 13 lines of code here. Your error indicates an invalid statement at line 17. It’s impossible for this to happen unless you made a mistake. There should be no line 17 at all.
Try importing this shared watchlist column: http://tos.mx/HYCVaUd