Combining the Stochastic and MACD into a Custom Scan
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 Ameritrade: www.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.
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]
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.
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.
I suggest you search the Q&A Forum to see if that has already been requested: https://www.hahn-tech.com/thinkorswim-forum-topics/
In addition to that I suggest you learn how to use the Condition Wizard which allows users to build their own custom scans without writing any code: https://www.hahn-tech.com/thinkorswim-scans-beginner-to-advanced/
Thank you so much for making this custom indicator
When I download the file.
where con I download it
The code for this video was never published. The object of this video was to show you that two studies can be combined into one, show users how to do that and encourage viewers to build their own.
Thanks for explaining this nicely.
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.
Thanks for taking the time to leave your feedback. If you found this video useful, wait until you see this one: https://www.hahn-tech.com/thinkorswim-condition-wizard/
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.
Thanks for taking the time to express your appreciation for the content on our site. I see you are trying to build a custom watchlist column. Please post this request in the Q&A forum where we can provide the most comprehensive solution: https://www.hahn-tech.com/ans/cat/watchlists/
Be sure to search before posting to see if your question has already been posted and answered.
Your videos are very helpful..I hope your efforts pay off for you. My sincere appreciation
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!
Hi Matt. Glad to know you have our videos helpful. For basic requests we provide a free Q&A forum on our site. You may submit your request here: https://www.hahn-tech.com/thinkorswim-forum-topics/
For more complex projects, especially ones you wish to keep private, we offer professional services here: https://www.hahn-tech.com/about/