Saturday, December 3, 2011

ThinkScript Included - My TTM_Squeeze Scanner For The CNBC Stock Challenge

The CNBC Million Dollar Stock Challenge has concluded. I did not win but one of my portfolios (Schnauzer, I named them after small dog breeds) that I was active with scored a 99.78% game rank percentile:
Allen Everhart ranks 1,497 on the Million Dollar Portfolio Challenge Top Traders Board
This result was achieved by investing in the few leveraged ETF's that were permitted and by shorting GBP/USD and a good deal of neglect. (Note: a portfolio that I made no investments with, only improving by bonus question money, scored 96.44% game rank percentile.)

Before the challenge started I developed a custom scanner in the ThinkDesktop platform but I did not use it all that much after I found out that leveraged ETFs were permitted investments. However, I do think active traders might find some merit (at least in the education of custom scanner construction) to this scanner.

Here is an image of the scanner loaded into the scan-tab:
My CNBC Scanner

Last Minimum 2 and Market Cap Minimum 500M were CNBC contest criteria that I could match with the standard fundamental filters.

Sizzle Index Minimum 0.5 is a filter I chose because it finds stocks that have options and that are seeing somewhat elevated option activity.  The sizzle index is a measure of option volume and the minimum of 0.5 means I am looking at stocks with 50% greater than average volume.

The last CNBC contest criteria was that volume averged over 100 days be greater than 50,000. For this, one needs to resort to a custom study filter:
  1. Click the Add Study Filter button on the upper right. This will append the AdxCrossover filter to the list (the list may scroll up hiding the Last Minimum 2 fundamental filter but it is still there.)
  2. Click the small triangle on the lower right of the AdxCrossover filter to drop down the list of standard study filters and select Custom, the last menu entry.
  3. In the Scanner Custom Filter dialogue, select the inspector button and highlight AdxCrossover() to replace that text:
  4.  Type the letters si and then select SimpleMovingAvg from the suggestion drop down list. Be sure to append () and then the syntax error will clear allowing the inspector box to appear.
  5. In the inspector box select VOLUME in the price type input box and set length to 100.
  6. Finally append >= 50000 to the text.
    (Note: custom filters are boolean ThinkScript expressions. They must evaluate to true or false - you cannot just cut and paste any ThinkScript code from a chart study.)
    This completed filter should look like:
  7. Click ok and you have created, perhaps, your first custom filter.

The last two filters are some special custom code for which you can repeat the above steps, more or less, to add:

(1.333333 * stdev(close, 20) / averageTrueRange(ATRLength = 20) >= 1) && (1.333333 * stdev(close, 20)[1] / averageTrueRange(ATRLength = 20)[1] < 1)

Inertia(close - ((Highest(high, 20) + Lowest(low, 20)) / 2 + ExpAverage(close, 20)) / 2, 20) > 0

These last two filters are the criteria that John Carter of Trade The Markets uses to indicate when to take a Bullish trade. You can verify this by bringing any of the stocks found in the scan and inspecting the charts with the TTM_Squeeze and TTM_wave studies. For example:

ANSS with a Bullish Squeeze Breakout
 I hope that was helpful to you all.



  1. Allen, I am extremely grateful and thankful for posting this think-scan. I have used it for the past month, and I can thank you enough for such an awesome tip. So far it has payed my college semester :)
    I was wondering if you can help me flip this think-scan for bearish plays....

    Thank you so very much!
    Your site ROCKS!!!!


    1. Change the relational operator on the last filter from "> 0" to "< 0"

  2. Hey Allen is a way you can reply your email here i shoot you few lines of a script i needed help with thank you.

    1. Sure, email to:

    2. Can you help me to program indicators, please!!

  3. How do i edit this script to identify the stock while its still in the squeeeze?

    1. Hi - you don't have to edit anything. There is a TTM_SqueezeScan() filter built into the TOS platform now. In SCAN/Stock Hacker click 'Add Study Filter' then in the drop-down menu for the Study input field select Licensed Studies/TTM_SqueezeScan() and you're done.

  4. Hi I am so thrilled I found your weblog, I really found you by accident, while I was researching on Digg for something else, Nonetheless I am here now and would just like to say cheers for a remarkable post and a all round entertaining blog (I also love the theme/design), I don't have time to go through it all at the moment but I have saved it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the great work. login

  5. Very cozy looking rooms. Let me know if your going to Mexico. Oh and btw. you should read our Tipping in Mexico guide if you do. It will save you a lot of awkward moments. scanning


Note: Only a member of this blog may post a comment.