Labels For Squeeze & Time Frame



New member
2019 Donor
Wanting to have a label (labels) on the bottom secion of my chart that shows me the squeeze information along with what time frame. Can someone help with that. I saw this on someones chart and liked it but can't find how they did it. I use 5 different charts but with just the lower indicators desplayed to the left side of my area and each are with a different time frame. So I can just see the TTm Squeeze for each in each of those timeframes. I have these stacked Then I have an upper chart to the right of that that just shows me the current time frame with my upper part displayed. Trying to figure out how to upload an image. Hope I am doing this right by asking. Thanks for any help.


Well-known member
Hi @brendab180 Attach a chart for free by going to
Here's a start.
# Squeeze Count Watchlist
# Mobius
# 11.09.2015
def Squeeze = BollingerBands().UpperBand < KeltnerChannels().Upper_Band;

def count = if !Squeeze
            then 0
            else if Squeeze
                 then count[1] + 1
                 else count[1];

AddLabel(1, if Squeeze then count else 0,
            if Squeeze 
            then Color.Black
            else Color.WHITE);
AssignBackgroundColor(if Squeeze then else color.white);


Well-known member
Here's another from the Think Script Lounge via the Universe of Thinkscript in the Tutorial Section.

11:08 Mobius: Here is the TTM Squeeze study that I wrote
# Momentum Squeeze
# Mobius
# Added Squeeze Label with directional color
# Label is green when momentum is ascending, red when descending

declare lower;

input length = 20; #hint length: Length for average calculation
input SDmult = 2.0;
input ATRmult = 1.5;

   def c = close;
   def h = high;
   def l = low;
   def K = (Highest(h, length) + Lowest(l, length)) /
               2 + ExpAverage(c, length);
  plot Momo = if isNaN(close)
              then double.nan
              else Inertia(c - K / 2, length);
       Momo.assignValueColor(if Momo > Momo[1] and Momo > 0
                             then Color.Cyan
                             else if Momo > 0 and Momo < Momo[1]
                             then Color.Blue
                             else if Momo < 0 and Momo < Momo[1]
                             then Color.Red
                             else Color.Yellow);

def SD = StDev(c, length);
def Avg = Average(c, length);
def ATR = Average(TrueRange(h, c, l), length);
def SDup = Avg + (SdMult * Sd);
def ATRup = Avg + (AtrMult * ATR);

plot Squeeze = if isNaN(c)
               then double.nan
               else if SDup < ATRup
               then 0
               else Double.NaN;




plot zero = if IsNaN(c) or !IsNaN(Squeeze) then Double.NaN else 0;

AddLabel(!isNaN(Squeeze), "Squeeze", if isAscending(Momo)
                                     then Color.Green
                                     else Color.Red);

# End Code - Momentum Squeeze


New member
2019 Donor
here is a pic of what I am looking for. I have the chart layout just as it looks but wanting the labels for the time frames where the ttm squeeze bottom charts are. And then like a count. If say time frame 30 min has two red dots at the moment would be in squeeze 2 and then when first green dot would be a time cycle so say time cycle 1 or fired. Something like that. I will try the part you posted to see what it looks like. Thanks for the feed back and helping with sharing a pic. :)