Multiple Time Frame (MTF) Squeeze Indicator for ThinkorSwim

horserider

horserider

Well-known member
VIP
@lucassow No. Never have used it. But read the code.

input time1 = AggregationPeriod.five_min; #hint time1: Plot @ 0.

input time2 = AggregationPeriod.ten_min; #hint time2: Plot @ 0.5.

input time3 = AggregationPeriod.twenty_min; #hint time3: Plot @ 1.

input time4 = AggregationPeriod.hour; #hint time4: Plot @ 1.5.

So 5 min squeeze is plotted at 0
10 Min plotted a 0.5 and so on
That gives you the agg periods

A red dot is a squeeze at that time agg. The more red dots at more aggs and bigger the squeeze.
 
markos

markos

Well-known member
VIP
@horserider THIS is how to do it. Notice in the study numbers that the AGG changes but the 20, 1.5, 2.0 do not. Excellent.
btw, please share complete chart and then just the study for the dots! If possible, greatly appreciated by all!
Sharing is Caring ;)
@horserider We think a lot of your work. Could you please share the whole Chart or Grid, Please? Thank you.
 
G

ganq

New member
2019 Donor
Hey @BenTen and @markos - How do you guys prefer to use this indicator?, I read through the link @BenTen posted, not sure how exactly the indicator is working but it does explain what the author plans to do based on the dots and color changes.
 
markos

markos

Well-known member
VIP
Hey @BenTen and @markos - How do you guys prefer to use this indicator?, I read through the link @BenTen posted, not sure how exactly the indicator is working but it does explain what the author plans to do based on the dots and color changes.
@ganq I don't use it but know that many do. To each their own. A squeeze happens when the Keltner Channels are inside the bounds of the Bollinger Bands. Keltner's are based on ATR and Bollinger's are based on Standard Deviation. They are both classified as Volatility Indicators. The explanation of these things should be looked for on the TDA website as well as school.stockcharts.com.
 
G

ganq

New member
2019 Donor
@ganq I don't use it but know that many do. To each their own. A squeeze happens when the Keltner Channels are inside the bounds of the Bollinger Bands. Keltner's are based on ATR and Bollinger's are based on Standard Deviation. They are both classified as Volatility Indicators. The explanation of these things should be look for on the TDA website as well as school.stockcharts.com.
Got it thanks!

Which Moving Averages are we using here for Keltner and BBs?
 
markos

markos

Well-known member
VIP
Check the code, it should be listed near the top as an Input.
Default for Bollinger Bands is usually 20 SMA and I believe Keltner's adjust off of ATR, don't know about MA's. (I could Be wrong, wife often reminds me that I am!)
In the Tutorial I have a short write up on Bollinger Bands please take a look.
 
Last edited:
G

ganq

New member
2019 Donor
Check the code, it should be listed near the top as an Input.
Default for Bollinger Bands is usually 20 SMA and I believe Keltner's adjust off of ATR. (I could Be wrong, wife often reminds me that I am!)
In the Tutorial I have a short write up on Bollinger Bands please take a look.
Thank you!
 
L

lucassow

New member
I tried the code.... it is for indicating sqeeuze from consolidation to breakout. But it is different from what i initially looking for. I was searching for indicator to show trending of candlestick from multiple timeframe on the current chart. I cant find it after searching around. If anyone has it, do inform me. Thank you in advance.
 
markos

markos

Well-known member
VIP
I tried the code.... it is for indicating sqeeuze from consolidation to breakout. But it is different from what i initially looking for. I was searching for indicator to show trending of candlestick from multiple timeframe on the current chart. I cant find it after searching around. If anyone has it, do inform me. Thank you in advance.
@lucassow we would like to help you. Your Signature line says: Newbies. New Hope.
Do you have a picture you could post? Use Imgur.com and paste it here.

We need more conformation because candlesticks do not trend, they fill out until the agg is done, then they start over.

What type of investing are you looking to do?
Retired and looking to play with your rolled over 401k? Nouveau Riche and bored? Young, hungry but little risk capital?

What is it about a TTM Squeeze that makes you think you want it? What @horserider posted is excellent.

Please help us help you.
 
L

lucassow

New member
@lucassow we would like to help you. Your Signature line says: Newbies. New Hope.
Do you have a picture you could post? Use Imgur.com and paste it here.

We need more conformation because candlesticks do not trend, they fill out until the agg is done, then they start over.

What type of investing are you looking to do?
Retired and looking to play with your rolled over 401k? Nouveau Riche and bored? Young, hungry but little risk capital?

What is it about a TTM Squeeze that makes you think you want it? What @horserider posted is excellent.

Please help us help you.
Hi Markos
example of the picture is here:

So if current candle 1M showing bearish, then you would see red dot. Then, you
want to know the trend up or down in 5M, 15M, and 30M just to see bigger picture.
So, instead of clicking 5M or 15M or 30M, you can actually see all of this candlestick
showing bullish/bearish in green/red dots all from same chart. It saves time.
It is a multi time frame shown on same chart.

I am a newbie with new hope. Young, hungry but little risk capital.
 
subharmonic

subharmonic

New member
Not sure about the blank spots but this is my version of the squeeze with MORE DOTS!
There are 6 aggregations, you can pick the "vote" for the topline to show is "x" of 6 are in line with each other.

Code:
declare lower;
input AP1 = AggregationPeriod.DAY;
input AP2 = AggregationPeriod.TWO_DAYS;
input AP3 = AggregationPeriod.THREE_DAYS;
input AP4 = AggregationPeriod.FOUR_DAYS;
input AP5 = AggregationPeriod.WEEK;
input AP6 = AggregationPeriod.MONTH;
input vote = 3;

def price1 = CLOSE(period = AP1);
def price2 = CLOSE(period = AP2);
def price3 = CLOSE(period = AP3);
def price4 = CLOSE(period = AP4);
def price5 = CLOSE(period = AP5);
def price6 = CLOSE(period = AP6);
def length = 20;
def nK = 1.5;
def nBB = 2.0;
def alertLine = 1.0;
def Sqz_Length = 3;

def squeezeDots1 = TTM_Squeeze(price1, length, nK, nBB, alertLine).SqueezeAlert;
def squeezeDots2 = TTM_Squeeze(price2, length, nK, nBB, alertLine).SqueezeAlert;
def squeezeDots3 = TTM_Squeeze(price3, length, nK, nBB, alertLine).SqueezeAlert;
def squeezeDots4 = TTM_Squeeze(price4, length, nK, nBB, alertLine).SqueezeAlert;
def squeezeDots5 = TTM_Squeeze(price5, length, nK, nBB, alertLine).SqueezeAlert;
def squeezeDots6 = TTM_Squeeze(price6, length, nK, nBB, alertLine).SqueezeAlert;



def Top_Plot = (squeezeDots1 + squeezeDots2 + squeezeDots3 + squeezeDots4 +  squeezeDots5 +squeezeDots6) >= Vote;

plot MTF_Sqz = 7;
MTF_Sqz.SetPaintingStrategy(PaintingStrategy.POINTS);
MTF_Sqz.AssignValueColor(if Top_Plot == 1 then Color.BLACK else Color.DARK_RED);
MTF_Sqz.SetLineWeight(5);

plot Sqeezy1 = if squeezeDots1 == 1 then squeezeDots1 + 5 else 6;
plot Sqeezy2 = if squeezeDots2 == 1 then squeezeDots2 + 4 else 5;
plot Sqeezy3 = if squeezeDots3 == 1 then squeezeDots3 + 3 else 4;
plot Sqeezy4 = if squeezeDots4 == 1 then squeezeDots4 + 2 else 3;
plot Sqeezy5 = if squeezeDots5 == 1 then squeezeDots5 + 1 else 2;
plot Sqeezy6 = if squeezeDots6 == 1 then squeezeDots6 else 1;

Sqeezy1.SetPaintingStrategy(PaintingStrategy.POINTS);
Sqeezy1.AssignValueColor(if squeezeDots1 == 1 then Color.DARK_GREEN else Color.DARK_RED);
Sqeezy1.SetLineWeight(3);
Sqeezy2.SetPaintingStrategy(PaintingStrategy.POINTS);
Sqeezy2.AssignValueColor(if squeezeDots2 == 1 then Color.DARK_GREEN else Color.DARK_RED);
Sqeezy2.SetLineWeight(3);
Sqeezy3.SetPaintingStrategy(PaintingStrategy.POINTS);
Sqeezy3.AssignValueColor(if squeezeDots3 == 1 then Color.DARK_GREEN else Color.DARK_RED);
Sqeezy3.SetLineWeight(3);
Sqeezy4.SetPaintingStrategy(PaintingStrategy.POINTS);
Sqeezy4.AssignValueColor(if squeezeDots5 == 1 then Color.DARK_GREEN else Color.DARK_RED);
Sqeezy4.SetLineWeight(3);
Sqeezy5.SetPaintingStrategy(PaintingStrategy.POINTS);
Sqeezy5.AssignValueColor(if squeezeDots5 == 1 then Color.DARK_GREEN else Color.DARK_RED);
Sqeezy5.SetLineWeight(3);
Sqeezy6.SetPaintingStrategy(PaintingStrategy.POINTS);
Sqeezy6.AssignValueColor(if squeezeDots6 == 1 then Color.DARK_GREEN else  Color.DARK_RED);
Sqeezy6.SetLineWeight(3);
 
Z

Zlotko

New member
VIP
subharmonic
I like your
How can I chang it to 1min, 2min, 5min, 9min, 30min ?
 
Z

Zlotko

New member
VIP
I did and it didn't work.
Did you try changing it to intraday ?
 
switchfire

switchfire

Member
VIP
@Zlotko are you from croatia or some slavik country?
 
S

scottstots

New member
@laketrader This is excellent with labels. It does complain if current timeframe is larger than a timeframe on the study. For eg, won't show a 5 minute sqz with 15 min chart complaining "Secondary period cannot be less than primary." I recently attended one of the webinars where they were selling something similar with another row of labels to show histogram colors as well and I was thinking if I can code this. I have never really coded in thinkscript but I will give it a go tomorrow. Another thing I might attempt will be to combine all the studies in 1 so upper study doesn't get flooded. Thank you so much for this!
 
Z

Zlotko

New member
VIP
Yes. I attended the webinars too.
It is cool tool, would definitely use it.
 
Top