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

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:

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:

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.

## DDE to RTD Conversion Status

May 3, 2014

I’m working on an update to the CAT tool that will use the new RTD components instead of the old broken DDE ones. Stay tuned for more updates on it.

## DDE Status between Excel and Think or Swim

February 24, 2014

If you are a DDE user you’ve noticed that it’s broken after this latest Think Desktop update. I just got word from the developers that they are looking to release improved capability this coming weekend. Now, please remember that development estimates are just that: estimates. This weekend is the goal. Don’t burn down your local village if it doesn’t happen on time. 😉

What they have should be better than the old DDE in terms of what we could do with it. It’s not two-way interaction with ToS, so done get that excited. It’s faster and more improved data handling that should be much easier to work with and more powerful for data handling inside of Excel. I’ll update as I know more.

## Update to Apple Open Interest Chart

September 19, 2013

Here’s an update to yesterday’s open interest chart for AAPL. You can see that the calls had about a 1% drop in overall open interest yesterday, as AAPL charged higher:

Open interest decline would suggest to me that options writers wanted less exposure and bought to close them out. I don’t know if that is accurate, so somebody correct me if not. Another small datapoint in the fade OI camp.

## Options Open Interest Over Time

September 18, 2013

As I’ve been collecting data from the OCC, I’ve created a database of the daily open interest numbers in all calls and all puts for each of the S&P 500 names. Now that I’ve got almost a months worth, here’s a couple of charts I found interesting. These show the open interest numbers for the September expiration, coming up this Friday. The first is for AAPL, which shows call OI accelerating over put OI over the last few days:

Compare that with the daily chart over the last 30 days, which has steadily fallen:

The next is for GOOG, and it shows that call and put OI’s crossed over at the end of August:

At the same time, GOOG was trending upward:

As with all data mining, I’m scratching my head to figure out what it means and if there’s any alpha there. It looks like you would want to fade the increases in OI from these charts. Leave a comment if you have any ideas of the meaning of these charts or other data that would be useful to mine out.