Multi-Divergence Scan for Think or Swim: MACD, RSI, CCI Divergence in Your Stock Scans

In my Multi-Divergence indicator, there is logic used that breaks the study filter when you try to use it in a scan. So I made a new indicator specifically for scanning by limiting it to only use MACD, RSI or CCI. Now it can be used in a watchlist scan, and it’s called “Pro_Divergence_Scan”. It is still a donor-only script, so use your blog donor info to access it in the Released Thinkscript Studies section of the Google site. If you’re not a donor, you can chip in by clicking the Donate button:

Instructions:  Import Pro_Divergence_Scan like any other study, then follow these directions to set up a scan with it.

Go to the scan tab in Think Desktop, and choose “Stock Hacker”.  Then you click “Add Study Filter” (First in screenshot below) then click the pencil to edit the default filter that is added (Second in screenshot):


Delete the default ADXCrossover() if there is one (Third in screenshot) and then click “Thinkscript Editor” (Fourth):


Choose your Aggregation period at the top (D for Daily in this example).  In the editor, type in “Pro_Divergence_Scan()” and then choose “Inspector” from the side panel.  You’ll see the Pro_Divergence_Scan study inputs and the four plots that you can scan for:

    1. BullDivs for Bullish Divergence on short timeframe
    2. BearDivs for Bearish Divergence on short timeframe
    3. BullDivl for Bullish Divergence on long timeframe
    4. BearDivl for Bearish Divergence on long timeframe



(As an aside, you can also type the name of any other study you have in your library at this thinkscript editor to get access to it for any filter.)

For the scan to trigger, you want to check for when your chosen plot value is equal to 1, because that’s what I coded the indicator to do.  To do this, add the string “==1” after the plot name, as shown here:


After this, click “Ok” and run your scan.  You may get a pop-up that warns that future changes to the study will not be reflected in this filter.  That just means that if you change the code in the Pro_Divergence_Scan, it won’t be reflected here.  The filter takes a snapshot of the code when you make the filter.  If you update the indicator, just delete the old filter and set it up again as above.

Tags: ,

11 Responses to “Multi-Divergence Scan for Think or Swim: MACD, RSI, CCI Divergence in Your Stock Scans”

  1. Mike Says:

    I have a question. I am pretty new to this, but am really technical so I can easily understand. After reading Dr. Elder’s book, I left with the impression that these divergences are not extremely common. However, in the study, they come up all over the place. Also, when I run the scan, it looks like every stock in the market comes up when I run it. I guess this makes sense since when using the study, there are arrows all over the place. What I am getting at is every chart I open has divergences, and the scan brings up every stock on the market. Am I doing something wrong? Thanks in advance!

  2. Prospectus Says:

    What inputs are you using?


  3. Mike Says:

    22, 11 on study, and 50, 2 on scan. I have tried several combos on scan too. Using daily for both. Thanks!

  4. Al / Allan / Daddy / SuperAl / MasterBoss Says:

    I saved 4 new and separate studies, one for each plot as above.
    For instance, 1 study has the following script: Pro_Divergence_Scan(study = “RSI”).BullDivl == 1
    When running this scan against 9278 stocks, I get 1914 hits.
    I’m not sure this makes sense; shouldn’t I be using any additional filters?
    Also, what headers/columns should be customize in my list?
    Plus, when I add the study Pro_Divergence_Scan(RSI, 50, 10) to a 6 month chart of RUT, all I see are tiny candles. For the entire 6 months, the floating box shows mostly n/a although there is the occasional period where 1 or more of the 4 plots = 1 rather than n/a, Regardless, they’re hard to differentiate on the chart.
    Any comments/help would be greatly appreciated.

  5. Prospectus Says:

    Email me so I can get more details from you about what you’re doing: readtheprospectus @ gmail


  6. Says:

    hi there I really like the blog you have set up here. Thanks and keep up the great work!

  7. Robot Says:

    Awesome post.

  8. TECH Says:


  9. Mohan Says:

    You blog is awesome. I am very new to TOS. I am using Pro_Divergence_Scan with MACD (12,26) for short & MACD (50,10) for long. What are the parameter values should I use for BearishLong BearishShort, BullishLong & BullishShort ? Your suggestion is appreciated!

  10. Prospectus Says:

    Those parameters are outputs from the scan. You set the scan to check for when the value is equal to 1. You check for the type of divergence you’re interested in. So if you want to find bullish short-term divergences, you check for BullDivs == 1.


  11. Mohan Says:

    Thank you.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: