J
jhorton56
New member
VIP
Can you explain a little about the two studies on the right side of your grid, the Theo Trade Cumulative QuanTicks, and the comparison of CANDLE and $ADSPD?
I used gray and yellow instead of black and orange b/c the background of my chart is black. I chose colors that work better for my eyes. I believe John uses the same colorsThanks @maverick0987
Looks like there is an issue(if I am not wrong) in the TTM squeeze label colors - I dont see black and Orange in the label code.. Can you please check.
I use ticks to avoid shorting on a day when buying pressure is high and vice-versa. You can google tick charts & Corey Rosenbloom to learn more about this. $ADSPD is Advance-Decline, which is just another market internal indicator. The Quanticks is just showing cumulative activity in the ticks from the cash open.Can you explain a little about the two studies on the right side of your grid, the Theo Trade Cumulative QuanTicks, and the comparison of CANDLE and $ADSPD?
All I did for that is goto the "Comparison" indicator already in TOS and move it from the upper to the lower portion of the chart (it will default to upper). Then type in $ADSPD as the ticker within the indicator parameters. Voila!Do you have the link to the $ADSPD Advance-Decline?
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);
do you or anyone know how to create a scan that when the dot on line 5 changes color (red to green and vice versa)?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);
Great question and this is where the 'discretionary' part of trading comes in. There are essentially two important things to note:Hey Maverick thanks for your work. I have a question for you and anyone else using Squeezes. They definitely work as far as predicting breakouts but I'm still having a hell of a time figuring out which direction the breakout will go. Any insights?
Thanks MavGreat question and this is where the 'discretionary' part of trading comes in. There are essentially two important things to note:
# Momentum Squeeze and Volume Mod 08.17.18
# Mobius
# Added Squeeze Label with directional color
# Label is green when momentum is ascending, red when descending
# Added UI for separate Squeeze and Oscillator lenghts
# This code precisely replicates TTM_Squeeze. At default settings
# the output is the same as TTM_Squeeze. Top is Momentum squeeze
# study and bottom is TTM_Squeeze. The Oscillator can be adjusted
# separately with this version. I prefer the oscillator at 13, as
# it makes it more timely
#
# Squeeze was originated by John Bollinger and the Momentum Oscillator
# has been around long before Carter's version. He just painted it
# those colors.
#
# Some years ago we ran some statistics on squeeze breakouts and
# it was right around 50/50 with some variance with price near high
# volume pivots being a bit more easily read.
#
# If there was a high volume pivot within 3 or 4 bars of a low and
# then a squeeze, the probability of an expansion in price upward was
# nearer 1 st dev. If there was a low volume high pivot near a squeeze
# the probability was for a downward expansion of price.
#
# Squeeze in those cases denotes the indecision (price compression)
# before a trend change. The same price compression is what the
# SuperTrend code picks up on
# Modified by blt, 7.26.2016
# Bars painted GRAY if we are in a squeeze, BLUE if we are long and
# ORANGE if we are short. Also added addverticalline when squeeze fires
declare lower;
input Slength = 20; #hint Slength: Length for Squeeze
input Klength = 20; #hint Klength: Length for Oscillator
input price = close;
input SDmult = 2.0;
input ATRmult = 1.5;
def K = (Highest(high, Klength) + Lowest(low, Klength)) /
2 + ExpAverage(close, Klength);
plot Momo = Inertia(price - K / 2, Klength);
Momo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Momo.SetLineWeight(3);
Momo.assignValueColor(if Momo > Momo[1] and Momo > 0
then Color.Cyan
else if Momo > 0 and Momo < Momo[1]
then Color.ORANGE
else if Momo < 0 and Momo < Momo[1]
then Color.Red
else Color.Yellow);
def SD = StDev(close, Slength);
def Avg = Average(close, Slength);
def ATR = Average(TrueRange(high, close, low), Slength);
def SDup = Avg + (SDmult * SD);
def ATRup = Avg + (ATRmult * ATR);
plot Squeeze = if SDup < ATRup
then 0
else Double.NaN;
Squeeze.SetPaintingStrategy(PaintingStrategy.POINTS);
Squeeze.SetLineWeight(3);
Squeeze.SetDefaultColor(Color.RED);
plot zero = if IsNaN(close) or !IsNaN(Squeeze) then Double.NaN else 0;
zero.SetPaintingStrategy(PaintingStrategy.POINTS);
zero.SetLineWeight(3);
zero.SetDefaultColor(Color.GREEN);
AddLabel(!IsNaN(Squeeze), "Squeeze", if IsAscending(Momo)
then Color.GREEN
else Color.RED);
# End Code - Momentum Squeeze
AddVerticalLine(!IsNaN(squeeze[1]) and IsNaN(squeeze), "Fired", Color.RED, Curve.FIRM);
#ADDED Volume###################################################################
#Colored Volume By Ethans080901
#Mod TroyX-8-17-18
#If today's closing price and volume is greater than 'n' days ago, color green
#If today's closing price is greater than 'n' days ago but volume is not, color blue
#If today's closing price is less than 'n' days ago, color orange
#If today's closing price is less than 'n' days ago but volume is not, color red
input n = 10;
def CN = Average(close, n);
def VN = Average(volume, n);
def G = close > CN and volume > VN ;
def B = close > CN and volume == VN;
def O = close < CN and volume == VN;
def R = close < CN and volume >= VN;
#Added volume Label
AddLabel( G, "Bullish Volume" , Color.CYAN); #Strong Bull
AddLabel( B, "Bullish Volume" , Color.blue); #Weak Bull
AddLabel( O, "Bearish Volume" , Color.YELLOW); #Weak Bear
AddLabel( R, "Bearish Volume" , Color.ORANGE); #Strong Bear
#How to use:
#Buy on Green or Blue
#Sell on Yellow or Orange
#End
And here is the MTF version I adapted:
# Momentum Squeeze and Volume Mod 08.17.18
# Mobius
# Added Squeeze Label with directional color
# Label is green when momentum is ascending, red when descending
# Added UI for separate Squeeze and Oscillator lenghts
# This code precisely replicates TTM_Squeeze. At default settings
# the output is the same as TTM_Squeeze. Top is Momentum squeeze
# study and bottom is TTM_Squeeze. The Oscillator can be adjusted
# separately with this version. I prefer the oscillator at 13, as
# it makes it more timely
#
# Squeeze was originated by John Bollinger and the Momentum Oscillator
# has been around long before Carter's version. He just painted it
# those colors.
#
# Some years ago we ran some statistics on squeeze breakouts and
# it was right around 50/50 with some variance with price near high
# volume pivots being a bit more easily read.
#
# If there was a high volume pivot within 3 or 4 bars of a low and
# then a squeeze, the probability of an expansion in price upward was
# nearer 1 st dev. If there was a low volume high pivot near a squeeze
# the probability was for a downward expansion of price.
#
# Squeeze in those cases denotes the indecision (price compression)
# before a trend change. The same price compression is what the
# SuperTrend code picks up on
# Modified by blt, 7.26.2016
# Bars painted GRAY if we are in a squeeze, BLUE if we are long and
# ORANGE if we are short. Also added addverticalline when squeeze fires
declare lower;
input AGG = AggregationPeriod.FIVE_MIN;
input Slength = 20; #hint Slength: Length for Squeeze
input Klength = 20; #hint Klength: Length for Oscillator
def price = close(period = AGG);
input SDmult = 2.0;
input ATRmult = 1.5;
def K = (Highest(high(period = AGG), Klength) + Lowest(low(period = AGG), Klength)) /
2 + ExpAverage(close(period = AGG), Klength);
plot Momo = Inertia(price - K / 2, Klength);
Momo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Momo.SetLineWeight(3);
Momo.assignValueColor(if Momo > Momo[1] and Momo > 0
then Color.Cyan
else if Momo > 0 and Momo < Momo[1]
then Color.ORANGE
else if Momo < 0 and Momo < Momo[1]
then Color.Red
else Color.Yellow);
def SD = StDev(close(period = AGG), Slength);
def Avg = Average(close(period = AGG), Slength);
def ATR = Average(TrueRange(high(period = AGG), close(period = AGG), low(period = AGG)), Slength);
def SDup = Avg + (SDmult * SD);
def ATRup = Avg + (ATRmult * ATR);
plot Squeeze = if SDup < ATRup
then 0
else Double.NaN;
Squeeze.SetPaintingStrategy(PaintingStrategy.POINTS);
Squeeze.SetLineWeight(3);
Squeeze.SetDefaultColor(Color.RED);
plot zero = if IsNaN(close(period = AGG)) or !IsNaN(Squeeze) then Double.NaN else 0;
zero.SetPaintingStrategy(PaintingStrategy.POINTS);
zero.SetLineWeight(3);
zero.SetDefaultColor(Color.GREEN);
AddLabel(!IsNaN(Squeeze), "Squeeze", if IsAscending(Momo)
then Color.GREEN
else Color.RED);
# End Code - Momentum Squeeze
AddVerticalLine(!IsNaN(squeeze[1]) and IsNaN(squeeze), "Fired", Color.RED, Curve.FIRM);
#ADDED Volume###################################################################
#Colored Volume By Ethans080901
#Mod TroyX-8-17-18
#If today's closing price and volume is greater than 'n' days ago, color green
#If today's closing price is greater than 'n' days ago but volume is not, color blue
#If today's closing price is less than 'n' days ago, color orange
#If today's closing price is less than 'n' days ago but volume is not, color red
input n = 10;
def CN = Average(close(period = AGG), n);
def VN = Average(volume(period = AGG), n);
def G = close(period = AGG) > CN and volume(period = AGG) > VN ;
def B = close(period = AGG) > CN and volume(period = AGG) == VN;
def O = close(period = AGG) < CN and volume(period = AGG) == VN;
def R = close(period = AGG) < CN and volume(period = AGG) >= VN;
#Added volume Label
AddLabel( G, "Bullish Volume" , Color.CYAN); #Strong Bull
AddLabel( B, "Bullish Volume" , Color.blue); #Weak Bull
AddLabel( O, "Bearish Volume" , Color.YELLOW); #Weak Bear
AddLabel( R, "Bearish Volume" , Color.ORANGE); #Strong Bear
#How to use:
#Buy on Green or Blue
#Sell on Yellow or Orange
#End
# Momentum Squeeze and Volume Mod 08.17.18
# Mobius
# Added Squeeze Label with directional color
# Label is green when momentum is ascending, red when descending
# Added UI for separate Squeeze and Oscillator lenghts
# This code precisely replicates TTM_Squeeze. At default settings
# the output is the same as TTM_Squeeze. Top is Momentum squeeze
# study and bottom is TTM_Squeeze. The Oscillator can be adjusted
# separately with this version. I prefer the oscillator at 13, as
# it makes it more timely
#
# Squeeze was originated by John Bollinger and the Momentum Oscillator
# has been around long before Carter's version. He just painted it
# those colors.
#
# Some years ago we ran some statistics on squeeze breakouts and
# it was right around 50/50 with some variance with price near high
# volume pivots being a bit more easily read.
#
# If there was a high volume pivot within 3 or 4 bars of a low and
# then a squeeze, the probability of an expansion in price upward was
# nearer 1 st dev. If there was a low volume high pivot near a squeeze
# the probability was for a downward expansion of price.
#
# Squeeze in those cases denotes the indecision (price compression)
# before a trend change. The same price compression is what the
# SuperTrend code picks up on
# Modified by blt, 7.26.2016
# Bars painted GRAY if we are in a squeeze, BLUE if we are long and
# ORANGE if we are short. Also added addverticalline when squeeze fires
declare lower;
input AGG = AggregationPeriod.FIVE_MIN;
input Slength = 20; #hint Slength: Length for Squeeze
input Klength = 20; #hint Klength: Length for Oscillator
def price = close(period = AGG);
input SDmult = 2.0;
input ATRmult = 1.5;
def K = (Highest(high(period = AGG), Klength) + Lowest(low(period = AGG), Klength)) /
2 + ExpAverage(close(period = AGG), Klength);
plot Momo = Inertia(close - K/2, Klength);
Momo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Momo.SetLineWeight(3);
Momo.assignValueColor(if Momo > Momo[1] and Momo > 0
then Color.Cyan
else if Momo > 0 and Momo < Momo[1]
then Color.ORANGE
else if Momo < 0 and Momo < Momo[1]
then Color.Red
else Color.Yellow);
def SD = StDev(close(period = AGG), Slength);
def Avg = Average(close(period = AGG), Slength);
def ATR = Average(TrueRange(high(period = AGG), close(period = AGG), low(period = AGG)), Slength);
def SDup = Avg + (SDmult * SD);
def ATRup = Avg + (ATRmult * ATR);
plot Squeeze = if SDup < ATRup
then 0
else Double.NaN;
Squeeze.SetPaintingStrategy(PaintingStrategy.POINTS);
Squeeze.SetLineWeight(3);
Squeeze.SetDefaultColor(Color.RED);
plot zero = if IsNaN(close(period = AGG)) or !IsNaN(Squeeze) then Double.NaN else 0;
zero.SetPaintingStrategy(PaintingStrategy.POINTS);
zero.SetLineWeight(3);
zero.SetDefaultColor(Color.GREEN);
AddLabel(!IsNaN(Squeeze), "Squeeze", if IsAscending(Momo)
then Color.GREEN
else Color.RED);
# End Code - Momentum Squeeze
AddVerticalLine(!IsNaN(squeeze[1]) and IsNaN(squeeze), "Fired", Color.RED, Curve.FIRM);
#ADDED Volume###################################################################
#Colored Volume By Ethans080901
#Mod TroyX-8-17-18
#If today's closing price and volume is greater than 'n' days ago, color green
#If today's closing price is greater than 'n' days ago but volume is not, color blue
#If today's closing price is less than 'n' days ago, color orange
#If today's closing price is less than 'n' days ago but volume is not, color red
input n = 10;
def CN = Average(close(period = AGG), n);
def VN = Average(volume(period = AGG), n);
def G = close(period = AGG) > CN and volume(period = AGG) > VN ;
def B = close(period = AGG) > CN and volume(period = AGG) == VN;
def O = close(period = AGG) < CN and volume(period = AGG) == VN;
def R = close(period = AGG) < CN and volume(period = AGG) >= VN;
#Added volume Label
AddLabel( G, "Bullish Volume" , Color.CYAN); #Strong Bull
AddLabel( B, "Bullish Volume" , Color.blue); #Weak Bull
AddLabel( O, "Bearish Volume" , Color.YELLOW); #Weak Bear
AddLabel( R, "Bearish Volume" , Color.ORANGE); #Strong Bear
#How to use:
#Buy on Green or Blue
#Sell on Yellow or Orange
#End
Hello, How do i get the histogram labels to appear right below the Squeeze labels? They are all appearing in one line or the same line instead of in two separate rows on the chart. Please help on this. Thanks much..!!Got it. That worked. Thank you!
declare lower;
DefineGlobalColor("TrendUp", Color.GREEN);
DefineGlobalColor("TrendDown", Color.RED);
input higher_time_frame_4 = AggregationPeriod.WEEK;
input higher_time_frame_3 = AggregationPeriod.four_DAYS;
input higher_time_frame_2 = AggregationPeriod.three_days;
input higher_time_frame_1 = AggregationPeriod.two_days;
input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def squeezeHist1 = reference TTM_Squeeze(close(period = higher_time_frame_1), 20, 1.5, 2.0, 1.0).Histogram;
def squeezeHist2 = reference TTM_Squeeze(close(period = higher_time_frame_2), 20, 1.5, 2.0, 1.0).Histogram;
def squeezeHist3 = reference TTM_Squeeze(close(period = higher_time_frame_3), 20, 1.5, 2.0, 1.0).Histogram;
def squeezeHist4 = reference TTM_Squeeze(close(period = higher_time_frame_4), 20, 1.5, 2.0, 1.0).Histogram;
def squeezeHist5 = reference TTM_Squeeze(close, 20, 1.5, 2.0, 1.0).Histogram;
plot HTF1 = if close then 4 else Double.NaN;
plot HTF2 = if close then 3 else Double.NaN;
plot HTF3 = if close then 2 else Double.NaN;
plot HTF4 = if close then 1 else Double.NaN;
plot HTF5 = if close then 0 else Double.NaN;
HTF1.SetPaintingStrategy(PaintingStrategy.POINTS);
HTF2.SetPaintingStrategy(PaintingStrategy.POINTS);
HTF3.SetPaintingStrategy(PaintingStrategy.POINTS);
HTF4.SetPaintingStrategy(PaintingStrategy.POINTS);
HTF5.SetPaintingStrategy(PaintingStrategy.POINTS);
HTF1.SetLineWeight(5);
HTF2.SetLineWeight(5);
HTF3.SetLineWeight(5);
HTF4.SetLineWeight(5);
HTF5.SetLineWeight(5);
HTF1.AssignValueColor(if squeezehist1 > squeezehist1[1] then GlobalColor("TrendUp") else GlobalColor("TrendDown"));
HTF2.AssignValueColor(if squeezehist2 > squeezehist2[1] then GlobalColor("TrendUp") else GlobalColor("TrendDown"));
HTF3.AssignValueColor(if squeezehist3 > squeezehist3[1] then GlobalColor("TrendUp") else GlobalColor("TrendDown"));
HTF4.AssignValueColor(if squeezehist4 > squeezehist4[1] then GlobalColor("TrendUp") else GlobalColor("TrendDown"));
HTF5.AssignValueColor(if squeezehist5 > squeezehist5[1] then GlobalColor("TrendUp") else GlobalColor("TrendDown"));
HTF1.HideBubble();
HTF2.HideBubble();
HTF3.HideBubble();
HTF4.HideBubble();
HTF5.HideBubble();
HTF1.HideTitle();
HTF2.HideTitle();
HTF3.HideTitle();
HTF4.HideTitle();
HTF5.HideTitle();
plot divider = 5;
divider.SetDefaultColor(Color.GRAY);
divider.HideBubble();
divider.HideTitle();
def alignmentLong = if SQUEEZEHIST1 > squeezehist1[1] and SQUEEZEHIST2 > squeezehist2[1] and SQUEEZEHIST3 > squeezehist3[1] and SQUEEZEHIST4 > squeezehist4[1] and SQUEEZEHIST5 > squeezehist5[1] then 1 else 0;
def alignmentShort = if SQUEEZEHIST1 < squeezehist1[1] and SQUEEZEHIST2 < squeezehist2[1] and SQUEEZEHIST3 < squeezehist3[1] and SQUEEZEHIST4 < squeezehist4[1] and SQUEEZEHIST5 < squeezehist5[1] then 1 else 0;
plot combinedTrend = if alignmentLong then 6 else if alignmentShort then 6 else Double.NaN;
combinedTrend.SetPaintingStrategy(PaintingStrategy.POINTS);
combinedTrend.SetLineWeight(5);
combinedTrend.AssignValueColor(if alignmentLong then GlobalColor("TrendUp") else GlobalColor("TrendDown"));
combinedTrend.HideBubble();
combinedTrend.HideTitle();
I created an MTF TTM Squeeze lower histogram but the formula for the TTM doesn't seem to work for timeframes other than the current timeframe I am looking at. The formula I am using is squeezeHist1 = reference TTM_Squeeze(close(period = higher_time_frame_1), 20, 1.5, 2.0, 1.0).Histogram;Should I start a new thread in the indicator forum with the correct version? I don't think anybody had made a MTF TTM_Squeeze lower histogram study yet.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
MTF (Multiple Time Frame) MACD Labels for ThinkorSwim | Indicators | 12 | ||
Multiple Time Frame (MTF) RSI Indicator for ThinkorSwim | Indicators | 36 | ||
I | Multiple Time Frame Trend Indicator for ThinkorSwim | Indicators | 16 | |
E | Plotting multiple lines with a loop | Questions | 0 | |
Multiple conditions in one scanner | Questions | 2 |