Thinkorswim Custom Scan Stochastic MACD 21


Combining the Stochastic and MACD into a Custom Scan

Thinkorswim Custom Scan Stochastic MACD

Thinkorswim Custom Scan Stochastic MACD

Have you ever wished you could take your favorite setup and convert it to a custom scan? Wouldn’t it be great to just press the scan button and instantly have a list of qualified charts to review? In this video, you learn how to convert the logic of your setup into a custom scan on the Thinkorswim platform. You’ll have to work with a little bit of scripting language. But don’t worry, I’ll show you step-by-step how to take your ideas and translate them into a clear signal the scan engine can understand. Even if you’ve never worked with a scripting language before, this video makes it easy.

IMPORTANT UPDATE: At the 15:05 mark of the video there is a typo in the “plot Data” statement which was corrected before reviewing the signals on the chart. You will find the corrected version of the “plot Data” statement is shown at the 18:14 mark of the video, just as I was copying the code to paste it into the scan. So please use the code as displayed at the 18:14 mark of the video. Sorry for any confusion this may cause.

Thinkorswim Custom Scan Stochastic MACD

This video demonstrates how to convert the plot lines from two different indicators and convert them into a true/false statement the scan engine can understand. Once you’ve mastered these techniques you will be spending much less time reviewing charts. Your own custom scans can filter out the low hanging fruit, saving your countless hours of chart time.

Lean More:

Would you like to learn how to master the custom scan tools on Thinkorswim?

Click here: Thinkorswim Scans Beginner to Advanced

Learn how to build custom scans without writing any code: Thinkorswim Condition Wizard

DISCLAIMER: I AM NOT A CERTIFIED FINANCIAL ADVISOR AND NOTHING IN THIS VIDEO OR TEXT IS AN ADVERTISEMENT OR RECOMMENDATION TO BUY OR SELL ANY FINANCIAL INSTRUMENT. NOR IS THIS VIDEO OR TEXT INTENDED TO INSTRUCT YOU ON HOW TO MAKE BUY OR SELL DECISIONS USING ANY OF THESE INDICATORS.

*Thinkorswim is a chart analysis platform offered by TD Ameritradewww.tdameritrade.com

TD Ameritrade provides financial services including the trading of Stocks, Futures, Options and Forex.

Please be sure to share this page with your friends and colleagues. Leaving comments below is the best way to help make the content of this site even better.

Watch the video,

Thinkorswim Custom Scan Stochastic MACD below:


About Pete Hahn

For those trying to contact me about our professional services you will find all those details here: https://www.hahn-tech.com/about/ Any questions not related to our professional services or premium indicators should be directed to the comment section of the applicable video or you may post a question in our Q&A Forum: https://www.hahn-tech.com/thinkorswim-forum-topics/

Questions? Comments? Post a review?

21 thoughts on “Thinkorswim Custom Scan Stochastic MACD

  • Greg H

    Great Video. Easy to follow. I have this scan incorporated into my ThinkorSwim. I am wondering when the Crossover Signal crosses over to the down side, if the Triangle ( \/ ) can be scripted to point downwards. Right now I have changed the color of it to Red to differentiate it from when the signal crosses to the up side ( /\ ). Here is my script for the crossover to the down side:
    [Edit: the code has been removed by the moderator]

    • Pete Hahn Post author

      Please check our Q&A Forum to see if someone has already requested this solution. The comments section of the video is not the ideal place to be posting code and requesting solutions of this type.

  • Dev Malhotra

    Mr. Hahn, Thank you for this info. Do you have a video about sell signal using MACD and Slow Stochastic please where we get a signal when MACD and SS lines cross from high to low? This is trying to duplicate the Investools system that I follow.

  • Wolfgang Schermuly

    Mr. Hahn,
    for years, I was looking out for something like this. You are the one who got me interested and encouraged to coding scans. Excellent education. Thank you so much. I now realize (actually its a foggy hunch) the disadvantage in efficiency the person has, who ignores this.

  • Kirk E. Zeller

    Hello Pete,
    I’m so glad I found your site which has immensely increased my understanding of TOS and its many features. I just found “OnDemand” on one of your other videos so I appreciate you demonstrating that capability. I’ll be doing more testing over weekends and evenings now. For this video (Thinkorswim Custom Scan Stochastic MACD) I am happy to be able to follow along with the instructions and try to see the long and short sides on the same scan. I’ve added this piece of code at the bottom and wanted your input if you would do it this way or differently. Thanks for all you do and I wish you success and great health over the weeks and months to come.

    def DataUp = (SlowK[1] SlowD) and (Lowest(SlowK[1], 3) Diff[2]);
    def DataDown = (SlowK[1] > SlowD[1]) and (SlowK > SlowD) and (Highest(SlowK[1], 3) > 50) and (Diff[1] < Diff[2]);

    def total = DataUp + (-DataDown);

    plot Data = total;

    Also, please help me with the added syntax to create a Scan for the "total" (+1 or -1) so I can add to a watchlist. If I understand correctly, I need to have a "plot scan; " statement after the inputs and a "scan = total " statement for total?

    Thanks again.

  • Matt Johnson

    Morning Pete,

    First off, thank you very much for your posts of videos like this. They really do help! And I like that you stay on course in your video and you don’t go off on tangents.

    I am trying to create a scanner that combines conditions of MACD and StochasticMomentumIndex. I have come up with a rough draft of code so far based on this video. I can’t seem to get it execute properly though. Could you please help? I need to share in greater detail what I’m looking for in the scan.

    Thank you!