Thinkorswim MTF MACD Scan 6


Create a Scan Based on Multiple Time Frame MACD

Thinkorswim MTF MACD Indicator

Thinkorswim MTF MACD Indicator

This is just a quick article (no video). I received several requests from viewers to demonstrate how to create a custom scan based on the Multi Time-Frame MACD indicator. This MTF MACD indicator is available free via the link embedded in the video located HERE, in a post called Thinkorswim MTF MACD Indicator. You will not need the indicator to build this scan, but be sure to go get it so you can plot it on your charts.

One more thing before we jump right in. If you are not familiar with building custom scans in the Thinkorswim platform, be sure to check out these posts to get up to speed: Thinkorswim Custom Scan Stochastic MACDThinkorswim Scan TTM Squeeze HistogramThinkorswim Scan MACD RSI Part Two. Everything presented here assumes you’ve already viewed at least one of these videos. So if you feel lost… take the few minutes to watch them and get up to speed.

Ok, here it is. As long as you’ve seen the previous videos, I can show you how to build this scan in two screen shots.

This first screen shot is the Scan tab on the Thinkorswim platform. It shows I’ve added three custom study filters. These are added by pressing the button titled “Add Study Filter”. Make sure you set each of the three to your desired time frame. In this case I’ve got mine set to Monthly, Weekly, and Daily. In the next step, you need to click the pencil icon for each of the three studies. The pencil icon opens up the code editing dialog box. I will provide the code here in this post. Scroll down to the next screen shot.

Setting up the MTF Scan

Setting up the MTF Scan

Ok, here is the code dialog box. I’ve clicked to select the tab titled “thinkscript Editor”. Just copy the code from this post into this screen on your platform. Notice the annotations in this screenshot indicate you can flip this from long to short by moving the “#’ symbol. Scroll down for the code to copy into your platform.

The Code Box

The Code Box

There are two DIFFERENT blocks of code here. This first one is to be placed into the two higher time frames. So for this example, I would have this first code block pasted into my Monthly and Weekly time frames.
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
def Diff = MACD(fastLength, slowLength, MACDLength, averageType).Diff;
plot scan = Diff[1] > Diff[2];
# OR
#plot scan = Diff[1] < Diff[2];

This second code block is to be pasted into the lowest time frame. In this example, I have this code pasted into my Daily time frame.
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
def Diff = MACD(fastLength, slowLength, MACDLength, averageType).Diff;
plot scan = Diff[1] <= Diff[2]; # OR #plot scan = Diff[1] >= Diff[2];

Don’t go anywhere yet. Here are some important tips:

Ok, that’s it. You’re done. Be sure to save the scan before you close the platform or it will be lost and you’ll have to rebuild it. Please note the code for this scan will ensure your higher time frames have at least one candle closed in the desired direction. This is important as it will remove any false signals (as are present in the current version of the MTF MACD Indicator). An updated indicator will be published in the near future. The other thing to note is the code for the lowest time frame is designed to pick only the very first signal in a series. So this scan is not going to pick up signals from 2-3 or more days ago. It’s going to pick up current signals only. So be sure to run it every day (if you are using the time frames displayed here).

__ Support our free content by making a purchase below. Thanks! __

Comments Drive Content of Future Posts:

6 thoughts on “Thinkorswim MTF MACD Scan

  • Rob Miller

    I am a bit confused on what the MTF scans for? Today’s scan(2-17-17) pulled up AAPL for the first one. It has neither a red or green dot. I set up my scan the exact way you have posted except for the MACD, I like 8,17,9. Other than that identical. Can you tell me what I did wrong? Is there a way to scan for red/green dots on the histogram? I also have the second version of the indicator as well, it seems the first version gives much faster signals.

    Also, The MACD stochastics scan, I’ve set it up like you did in the video and it works great. I tried reversing what I thought was needed to pull up the short trades but had no luck. Any tips on what I should switch to pull up the opposite for short trades? Thanks for your help.

    • Pete Hahn Post author

      I’ll be able to provide much more detailed response if you post your question in our Q&A forum. As for your question about getting the results of the MTF MACD scan to match the indicator, be sure you are comparing it to version two and not the original. Version two is located here: Thinkorswim Strategy Guide MTF

  • Hilario Dsouza

    Hi Pete,
    I like the Multiple time frame approach and I am seeing it is pretty accurate for stocks (I added a few more indicators). I am applying a similar strategy to Futures. So lets take for example /CL with 133 tick, 233 tick, 1 min and 2 min. So to make it simple, when the SMA Crosses over the EMA and there is a confluence over all 4 charts, how can I get a SINGLE ALERT. (I dont mind keeping all the charts open in detached windows). Currently I am able to get 4 alerts (one for each chart).

    Thanks and Happy Holidays
    Hil

      • Pete Hahn Post author

        We could definitely provide more assistance if this were posted to the Q&A forum. So it sounds like y0u would like a chart based study using 4 time frames that would give you audible and visual alerts while the chart is open. If that is the case, then the solution is a bit more complex than we could provide in the Q&A forum. You should consider submitting this as a custom thinnkscript project using the contact form at the bottom of the “About” page.