♥ 0 |
Hi Hahn, I was looking for a specific MTF scanner for ThinkorSwim but couldn’t quite find what i wanted. I’m wondering if you can help me out with this. I basically want a Multi Time Frame Indicator with the ability to visualize at least four short term time frames in a given chart (between 5 mins to 60 mins). While, there are ready-made indicators available that to do this, but none come with a scanner. I’d like the indicator to continuously scan all the exchange-traded stocks with the preset conditions and therefore set off an alert once it sees that the prices relative to each individual time-frame are moving in the same direction, hence signalling a probable reversal or breakout. I hope i am clear in explaining myself. Thanks again!
Marked as spam
|
Private answer
About all we can help you with here is to show you what it looks like to build a MTF scan. This article provides step-by-step instructions, with code. This one covers our own MTF MACD (version 2): https://www.hahn-tech.com/thinkorswim-mtf-macd-scan/
Marked as spam
|
Please log in to post questions.
Hi Pete,
Thanks again. Sorry, i have been asking questions all over the place, so i thought i would just stick to this thread. I wanted to post screenshots of my custom settings on the indicator and scan, but i will write it down for you to see here.
I did install the indicator first, and customised it to my requirements, where i wanted the base chart to be 5 minutes, and the multi-time frames on the indicator to be 15 min, 30 min, 60 min.
My settings hence were:
Inputs:
Mid term period : 15 min
Long term period: 30 min
Fast length: 15
Slow length: 60
Macd length: 30
Midterm fast length: 15
Midterm slow length: 60
Midterm Macd length: 30
Longterm fast length: 15
Longterm slow length: 60
Longterm Macd length: 30
Can you please help confirm that i have chosen the correct inputs to suit my needs as i stated above?
Now, to the scanner.
In the Add Study Filter Option, I chose the three time frames, as 1 hour, 30 mins, 15 mins, in place of Monthly, Weekly and Daily that you had.
I also edited the code to be as such for 1 hour and 30 min (my higher timeframes):
input fastLength = 15;
input slowLength = 60;
input MACDLength = 30;
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]; Likewise for 15 min, (since it is my lowest timeframe), input fastLength = 15; input slowLength = 60; input MACDLength = 30; input averageType = AverageType.EXPONENTIAL; def Diff = MACD(fastLength, slowLength, MACDLength, averageType).Diff; plot scan = Diff[1] = Diff[2]; I am obviously not sure if I have done this correctly, because i changed the 12-26-9 to 15-60-30 which can very well mean 15-60-30 days, and not minutes, since that was your base configuration if i am right in understanding? So can you also please tell me what the right code would be? Lastly, is there a way to change the type of Moving Average in the indicator to be from Exponential to Simple? I can see, there's an option in the scanner code, where i can simply write Simple instead of Exponential. Would it work that way? And will there be a conflict between the indicator and the scanner, if there's no way to change the MA type on the indicator, but if i can on the scanner. I know, those are a lot of questions, and would love to be able to make my post with images and proper editing so it is easy on the eye, but the Add Comment section only supports HTML input. Thanks again, Pete! I am a student who is beginning to trade and I appreciate all your help.
The input settings, fastLength, slowLength and MACDLength have absolutely nothing to do with time frames. Those are the inputs for the standard MACD. The standard default settings of 12,26,9 have no connection whatsoever to time frames.
For scans, the time frames are set on each study filter. I provided a link in my previous answer to show how those multiple time frames are set. Since you seem to have missed it. They are shown on the first screenshot. The buttons immediately to the left of the pencil icons. In my example they are set to Mo, Wk, and D. This is where you change your time frame. NOT in the code. Hope that clears that up.
Since this was not already understood, you should spend some time watching videos in our Scans category. Seems you really don’t have a good grasp and working with Scans. And you are trying to do something like build a complex MTF scan? You should start with the basics and build your knowledge slowly. There are no short cuts.
To change the moving average type. You can get a list of available options here: http://toslc.thinkorswim.com/center/reference/thinkScript/Constants/AverageType.html
When you click on the word SIMPLE in that list you will find it is defined as “AverageType.SIMPLE”
Thanks Pete. You are right about the fact that i should start with basics. I will take a look at your other videos.