Thinkorswim Scan TTM Squeeze Histogram 61

Creating a Custom Scan Using TTM Squeeze Histogram

Thinkorswim Scan TTM Squeeze Histogram

Thinkorswim Scan TTM Squeeze Histogram

Learn how to build custom stock scans and spend less time reviewing charts. This video shows that you don’t need access to the source code to write a customized scan for a licensed indicator on the Thinkorswim platform. In this video, Thinkorswim Scan TTM Squeeze Histogram, you will learn how to build and run a custom scan. You will receive a free custom scan indicator via clicking the link below. This indicator is actually four different scans built into one. This video shows how to select which of the four scans to run.


*The TTM Squeeze is a proprietary indicator owned by Trade The Markets. It is available free to all TD Ameritrade clients who have access to 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.

Watch the video, Thinkorswim Scan TTM Squeeze Histogram below:

Questions? Comments? Post a review?

61 thoughts on “Thinkorswim Scan TTM Squeeze Histogram

  • Bron Horton

    Hi Pete, great work!. When I click on the .ts file in the description I don’t have anything that will open it. It seems to be a video file. Am I clicking on the right link to get the code? Thanks,

      • Bron Horton

        Thanks Pete, I changed the file name extension and it opened in Word. Another question Pete. I’ve checked out John Carter’s video on the squeeze and he’s interested in the moment in time when the Bollinger bands expand outside of the Keltner Channels as a buy signal. This is indicated when red dots run into green dots. The histogram, based on the Momentum Oscillator, suggest direction. Is your intent with the zero line crossover to focus only on the change in momentum without the Bollinger Band compression? Thanks again!

      • Pete Hahn Post author

        The intention of the video was to show how to create a scan that is based on the histogram. Anything more than this is outside the context of this particular video. If you are looking for information about how to scan for the red and green dots on the center-line you will find those solutions posted in our Q&A Forum.

  • Walid

    Hi Pete, first of all, I highly appreciate your support and the knowledge you’re sharing.
    I copied your code above to new Strategy and tried to add an AddOrder to it to show the same spike position as an Entry signal on the chart but it didn’t work.
    Here are below the lines that I added:
    def EntrySignal = zeroLinePositiveFollowThrough;
    AddOrder(OrderType.BUY_AUTO, EntrySignal, tickcolor = GetColor(2), arrowcolor = GetColor(4), name = “TTM_SQ EP”);

    Thanks for your explanation and support.

  • Eddie Valladares

    Hey Pete. First I want to congratulate you for the excellent job you are doing here. The content is excellent and extremely valuable. Thanks. I was wondering if you have available another video like this one ,with instructions of how to set up a scan and the study to go short on the stocks. I guess is a matter of changing the code description. If you can point me to the reight direction I will really appreciate it.
    Thanks in advance

  • joe c

    I added the code to the scan and charts. I am trying to sort just by Low to high pivot but ts scans all names that have done it looking back so i get 4000 results. How do i scan so it just tells me if it changed in the current or very recent period?

  • Stock Enthusiast

    I dowloaded the code and added this in the Chart studies and also in the TOS Scan filter. But when I do the scan the squeeze histogram is not spiked up in the chart even when the Stock is showing up in the scanner.

    • Pete Hahn Post author

      Check that you have set the time frame exactly the same on both. If you are using intraday time frame check the chart setting named “Start Aggregation at market open” That needs to be turned off or your intraday charts will never match the rest of the tools on the platform.

    • Pete Hahn Post author

      A scan is not a watchlist. So lets make sure we understand the terms. It is possible to link a watchlist but it is not possible to link the results section of a scan.

  • cmorgh

    I copy/pasted the “Strat_PivotRev_TrailSqz” script directly from the website onto ThinkScript Editor and made sure any previous lines were deleted, still no error codes and still “ok” button is disabled.

    • Pete Hahn Post author

      Sorry but I can’t help you here. I just tested it and it’s works fine. I suggest you post this in the Q&A forum and include a screenshot showing what your scan look like. Perhaps we can see something you missed.

  • cmorgh

    Thank you for the educational videos. I have a question: after I try to create a custom scan in ThinkScript Editor, the “OK” button remains grey and won’t let me save it, I have tried many times, there are no error codes in the script, the “OK” button is still grey and I cannot save it, could you help please ? Thank you.

    • Pete Hahn Post author

      There are only two scenarios in which the OK button is disabled One is when the code generates an error. Second would be if the code editor was empty. If you have code in the editor and the OK button is disabled but still don’t see an error there must be something blocking you from seeing it.

  • Scott Fletcher

    Been working with your TTM Squeeze just recently and trying to change the scan to alert me when the red or yellow bars are below a given level so that I can check the stock out and perhaps put it on another watch list to watch closer. Another option may be two have two consecutive yellow bars as the 2nd is the confirmation bar. Those would be ideal options. Can this be done?

  • Rick Wrightson

    TTM_Squeeze histogram
    When I copy/pasted your script, it produced three errors. (I’m on a macOS 10.16.3)

    Invalid statement: plot at 9:1
    Invalid statement: assignBackgroundC… at 13:1
    Invalid statement: hist at 17:1

    Any suggestions?

    My buddy is on Windows and he has it running. Is there a difference in the macOS and WindowsOS library that might cause these errors?


      • Pete Hahn Post author

        No, that is not the link I provided. Here it is again. Just import this directly and don’t bother trying to copy/paste:
        Also, don’t try pasting code in the comment section of a video The Q&A forum is the place to request more advanced assistance. But you will not need any more assistance because that link I included above will bypass the entire issue you are having.

      • Rick Wrightson

        Peter, thank you VERY much for your reply and the link. Understand not posting code in comment section of the video…if I can, I will delete it. BTW, the reason I had 17 lines is because I tried to match the script in your video…it had null lines and, therefore, had 17 lines. I put in the null lines and tried to match the video line for line.

        Actually, now that we’re in a COVID-19 non-social status, we stayed in last night and I went through all of your tutorials and was successfully able to do each of your scripts. (I also found your post with the shared link in the other post thread…thanks)

        Thinkorswim TTM Squeeze Watchlist
        Thinkorswim Custom Watch List Columns
        Thinkorswim Watchlist TTM Squeeze
        Custom Watchlist Columns Colored to Match Dots on TTM Squeeze Centerline

        I also was successful in creating three additional columns for daily, weekly and monthly (and, following your suggestion, named them D_Sqz, W_Sqz, M_Sqz)…I now have three columns with color. Which leads me to one more question: in Charts, we are able to customize a time frame but we don’t seem to have that option in watchlist time frames. Is that correct?

        You have provided your followers with some excellent add on tools…thank you.

      • Pete Hahn Post author

        Thanks so much for taking the time to let us know what you did and how you got things working. Glad things are setup and working for you now. As for custom time frames, those are only supported on the charts. This is not available anywhere else on the platform, yet. Be sure to submit a feature request to TDA support if custom time frames across the platform are essential to your trading success. Thanks for the voluntary contribution too! Take care.

  • Dean

    Im no good with coding but i have it setup so i can run the pivot high and the pivot low at the same time,pivot low spike colored green and pivot high red.

  • Steve Bui

    I would like to install Custom Scan Using TTM Squeeze Histogram on my Thinkorswim platform as you introduce in the above Video. Please provide to me the instructions and the Thinkscript Codes so I can copy and paste later. Are there any charges for this service? Please let me know. Thank you very much.

    • Pete Hahn Post author

      There is no charge for the code associated with this video. The link to download the code is included in the video description and also within the video itself.

  • Phillip Gonzales

    great video. I am trying to use the same scan but i can not figure out how to change it to notify me when there is a 1 bar pivot. Would you be able to help.

  • Enri

    Hi,I’ve been struggling to build a scan/study that indicates when there is a squeeze set off either positive or negative I don’t see the value for the actual squeeze indicator (dots) change from 0 only in color on ToS. Is there any way to isolate the spikes for only when a green dot is set off after a single or series of red dots? In other words apply these scans but only for periods directly after market compression? Or is this impossible without access to the source code? Can it be recreated using the fundamentals of the TTM_Squeeze indicator?

      • Enri

        Thank you Pete for pointing me in the right direction, I was able to use the code from the licensed scan to back test positive and negative squeeze offs, is there a way to filter out strategies that happen pre/post market?

      • Meiers

        Enri, that sounds like a nice code. Would you be able to post your codes for the positive and negative squeeze off? Also, which licensed study did you base it off of? Thanks.

    • Meiers

      That sounds like a nice code. Would you be able to post your codes for the positive and negative squeeze off? Also, which licensed study did you base it off of? Thanks.

  • Steve

    I am on an older macbook pro, and am unable to follow the directions for importing the file into TOS so I tried manually entering the code EXACTLY as it appears on your video, and TOS gives me a “value never assigned to scan at 10:6”
    Not sure why this is happening and I’m hoping you have some insight, as this scan would save me many hours of searching. Thanks for everything you do and provide here!

      • Steve

        Pete – thank you for the prompt reply! I have not yet checked out the FAQs, but will do so shortly. If I have any issues at that point I’ll follow back up with you. Thanks again.

      • Steve

        Hi Pete – I didn’t realize that I had gone through all those steps last night when I saw your reply this morning. I tried again to no avail. I have taken a bunch of photos to document the process, but am uncomfortable posting certain identifying aspects of the process here.
        I guess I’ll just try to sort it out again, or live without it. Thanks again for your help.

      • Steve

        PS – for whatever it’s worth, I was able to copy the code directly from your post for the TTM multi-colored watch list, and paste it successfully.