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

September 13, 2016

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):

screen-shot-2016-09-11-at-7-19-25-pm

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

screen-shot-2016-09-11-at-7-19-47-pm

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

 

screen-shot-2016-09-11-at-7-25-30-pm

(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:

screen-shot-2016-09-11-at-7-25-54-pm

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.

Email Problems

June 22, 2016

If you’ve been trying to reach me, check your spam folders for my replies. My messages seem to not be getting through to people. 

Multi-Divergence Indicator for Think or Swim: MACD, RSI, CCI, On Balance Volume and many more

January 11, 2015

whatitlookslikenew

I figured out a way to combine all my divergence indicators into one single study. The new Multi-divergence script uses slopes of linear regression lines just like in the new MACD divergence indicator. This script supersedes all the other divergence scripts. The difference is now it can perform a regression on any one study of your choice from a list of ToS indicators. The indicators currently supported for divergence analysis are:

MACD, RSI, CCI, Momentum, Moneyflow, On Balance Volume, Rate of Change, Stochastic Momentum Index, Ultimate Oscillator, Volume Flow Indicator, Volume Oscillator, Volume Rate of Change, Volume-Weighted MACD, Williams Percent-R, and Woodie’s CCI

(Note that it doesn’t scan all of these for divergence at once. Just the one indicator you select. If you want to have RSI and MACD at the same time for example, you put the script on your chart twice and select the appropriate indicator for each one separately.)

If there is another built-in ToS indicator you want to have available for divergence analysis, let me know and I can add it in future updates. You can use the Multi-divergence indicator on real time charts and in scans of watch lists, and I put in alert logic so it can ping you when a divergence occurs.

This indicator is for blog donors only.  You can find it on my google site under Released Thinkscript Studies down in the Donors Only section. If you already donated in the past you can use your password to access it. If you want to become a donor (or throw me some more coin) you can do so by clicking the Donate button:

As always, if you are a DIY’er, feel free to ask questions in the comments and I’ll help answer.

Complex Analysis Tool (CAT): Analyzing and Recording Think or Swim RTD Data in Excel

December 19, 2014

I just updated the stock Excel CAT tool to use RTD instead of the now defunct DDE. This only works on Excel for Windows unfortunately. You can go download it now from my Google Site under Released Tools in the Donors Only folder. If you already donated in the past you can use your password to access it. If you want to become a donor (or throw me some more coin) you can do so by clicking the Donate button:

If you want to learn more about the CAT, the original blog entry is found here.

UPDATE: MACD Divergence Indicator for Think or Swim

December 10, 2014

This indicator has been updated!  See the new post here.

This has been a long time in coming.  My family life has been in upheaval for a couple years now.  I finally had a bit of time so I wanted to get this done.  Thanks for staying with me.

Many people have asked for a version of the MACD Divergence Indicator that can run in a scan.  The old one I had ran on recursive logic and so wasn’t supported in scans.  This new one uses a different philosophy that runs in real time.  Before I would use my Swing Points and check the value of the MACD against them.  Higher swing highs and lower corresponding values of MACD on those bars would signal a bearish divergence.  Now I am using Linear Regression slopes to compare divergences.  Here’s the theory of how it works:

A linear regression is a way to fit a straight line through some data such that you get the least amount of average distance from the line. If the slope of the linear regression is up, then values are generally trending upward over the set of data you put in. If the slope is negative, then the values trend downward.

So I take a linear regression of price, then get the slope of the LR, and I also take a linear regression of the standard MACD indicator and get that slope. When the price slope is positive and the MACD slope is negative, we have a bearish MACD divergence. If price slope is negative and MACD slope is positive, we have a bullish divergence. If price slope and MACD slope are the same, we have a trend continuation (up/up or down/down). This chart shows this theory in action:

howitworks

 

Here’s what my indicator actually looks like.  The small arrows are short term divergences, the larger arrows are the long term divergences.  The short and long timeframes are inputs, so you can set them at whatever you want.  This chart uses 20 and 50 as the inputs, but you can experiment with what works best for what you are trading:

whatitlookslikenew

As with all divergences, just because it is there doesn’t mean that the trend must reverse. Sometimes divergences can go on for a long time. This information is good to give you a sense that a trend might reverse, and you can plan your own entry and stop accordingly.

Now, to set set up a custom scan, you follow the instructions in these pictures:

scan1

scan2

Then when your scan runs, you will get flagged if the divergence you asked for is currently found.

This indicator is for blog donors only.  You can find it on my google site under Released Thinkscript Studies down in the Donors Only section.