Repaints Multi Time Frame MTF Squeeze PRO Labels for ThinkOrSwim

Repaints

caseyjbrett

Member
Here is the script I wrote for MTF (Multi Time Frame) Squeeze Pro Labels. Just to be clear, this is NOT the same as my MTF Squeeze HISTOGRAM Labels. These labels change colors based on the presence/absence of a squeeze. If there's an original squeeze, the label's red, if there's a "Pre-Squeeze" the label's orange, if there's an "Extra-Squeeze" the label's yellow, and if there's no squeeze, the label's green. Per a recent comment under my MTF Squeeze HISTOGRAM Labels thread, I have revised this script (1/5/2022). This script is more succinct with the Global Colors. More importantly, you are now able to turn on/off any time frames that you do not wish to be displayed on your chart(s). Enjoy!
Code:
#MTF SQUEEZE PRO LABELS
#BY: CASEY BRETT WITH THE USE OF CODE FROM: TOS Indicators

##Global Variables
input length = 20;
def AlertLine = 1;
input nk = 1.5;
input nkHi = 2;
input nkLo = 1;
def nBB = 2;
input averageType = AverageType.EXPONENTIAL;
def displace = 0;
input trueRangeAverageType = AverageType.SIMPLE;


input MonthLabel = yes;
input WeekLabel = yes;
input FourDayLabel = yes;
input ThreeDayLabel = yes;
input TwoDayLabel = yes;
input DayLabel = yes;
input FourHourLabel = yes;
input TwoHourLabel = yes;
input HourLabel = yes;
input ThirtyMinLabel = yes;
input TwentyMinLabel = yes;
input FifteenMinLabel = yes;
input TenMinLabel = yes;
input FiveMinLabel = yes;
input FourMinLabel = yes;
input ThreeMinLabel = yes;
input TwoMinLabel = yes;
input OneMinLabel = yes;


DefineGlobalColor("Squeeze", Color.RED);
DefineGlobalColor("PreSqueeze", Color.ORANGE);
DefineGlobalColor("ExtraSqueeze", Color.YELLOW);
DefineGlobalColor("NO Squeeze", Color.DARK_GREEN);

## Month Aggregation Period Variables

def monthPrice;
def monthATR;
def monthSDev;
def monthDenom;
def monthDenomLo;
def monthDenomHi;
def monthBBSInd;
def monthBBSIndLo;
def monthBBSIndHi;
def monthSqueeze;
def monthPreSqueeze;
def monthExtraSqueeze;
def monthAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.MONTH {
    monthPrice = close(period = "Month");
    monthATR = Average(TrueRange(high (period = "Month"), close(period = "Month"), low(period = "Month")), length);
    monthSDev = StDev(monthPrice, length);
    monthDenom = (nk * monthATR);
    monthDenomLo = (nkLo * monthATR);
    monthDenomHi = (nkHi * monthATR);
    monthBBSInd = If (monthDenom <> 0, ((nBB * monthSDev) / monthDenom), 0);
    monthBBSIndLo = If (monthDenomLo <> 0, ((nBB * monthSDev) / monthDenomLo), 0);
    monthBBSIndHi = If (monthDenomHi <> 0, ((nBB * monthSDev) / monthDenomHi), 0);
    monthSqueeze = if monthBBSInd < AlertLine then 1 else 0;
    monthPreSqueeze = if monthBBSIndHi < AlertLine then 1 else 0;
    monthExtraSqueeze = if monthBBSIndLo < AlertLine then 1 else 0;
    monthAggregationPeriod = 1;
}
else {
    monthPrice = 0;
    monthATR = 0;
    monthSDev = 0;
    monthDenom = 0;
    monthDenomLo = 0;
    monthDenomHi = 0;
    monthBBSInd = 0;
    monthBBSIndLo = 0;
    monthBBSIndHi = 0;
    monthSqueeze = 0;
    monthPreSqueeze = 0;
    monthExtraSqueeze = 0;
    monthAggregationPeriod = 0;
}
AddLabel(MonthLabel and monthAggregationPeriod, "M", if monthSqueeze then GlobalColor("Squeeze") else if monthExtraSqueeze then GlobalColor("ExtraSqueeze") else if monthPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def weekPrice;
def weekATR;
def weekSDev;
def weekDenom;
def weekDenomLo;
def weekDenomHi;
def weekBBSInd;
def weekBBSIndLo;
def weekBBSIndHi;
def weekSqueeze;
def weekPreSqueeze;
def weekExtraSqueeze;
def WeekAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.WEEK {
    weekPrice = close(period = "week");
    weekATR = Average(TrueRange(high (period = "week"), close(period = "week"), low(period = "week")), length);
    weekSDev = StDev(weekPrice, length);
    weekDenom = (nk * weekATR);
    weekDenomLo = (nkLo * weekATR);
    weekDenomHi = (nkHi * weekATR);
    weekBBSInd = If (weekDenom <> 0, ((nBB * weekSDev) / weekDenom), 0);
    weekBBSIndLo = If (weekDenomLo <> 0, ((nBB * weekSDev) / weekDenomLo), 0);
    weekBBSIndHi = If (weekDenomHi <> 0, ((nBB * weekSDev) / weekDenomHi), 0);
    weekSqueeze = if weekBBSInd < AlertLine then 1 else 0;
    weekPreSqueeze = if weekBBSIndHi < AlertLine then 1 else 0;
    weekExtraSqueeze = if weekBBSIndLo < AlertLine then 1 else 0;
    WeekAggregationPeriod = 1;
}
else {
    weekPrice = 0;
    weekATR = 0;
    weekSDev = 0;
    weekDenom = 0;
    weekDenomLo = 0;
    weekDenomHi = 0;
    weekBBSInd = 0;
    weekBBSIndLo = 0;
    weekBBSIndHi = 0;
    weekSqueeze = 0;
    weekPreSqueeze = 0;
    weekExtraSqueeze = 0;
    WeekAggregationPeriod = 0;
}
AddLabel(WeekLabel and WeekAggregationPeriod, "W", if weekSqueeze then GlobalColor("Squeeze") else if weekExtraSqueeze then GlobalColor("ExtraSqueeze") else if weekPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
# AddLabel(weekExtraSqueeze and weekAggregationPeriod, "W", globalColor("week Squeeze"));
# AddLabel(!weekSqueeze and weekAggregationPeriod,"W", globalColor("NO week Squeeze"));


def four_daysPrice;
def four_daysATR;
def four_daysSDev;
def four_daysDenom;
def four_daysDenomLo;
def four_daysDenomHi;
def four_daysBBSInd;
def four_daysBBSIndLo;
def four_daysBBSIndHi;
def four_daysSqueeze;
def four_daysPreSqueeze;
def four_daysExtraSqueeze;
def Four_DayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FOUR_DAYS {
    four_daysPrice = close(period = "4 Days");
    four_daysATR = Average(TrueRange(high (period = "4 Days"), close(period = "4 Days"), low(period = "4 Days")), length);
    four_daysSDev = StDev(four_daysPrice, length);
    four_daysDenom = (nk * four_daysATR);
    four_daysDenomLo = (nkLo * four_daysATR);
    four_daysDenomHi = (nkHi * four_daysATR);
    four_daysBBSInd = If (four_daysDenom <> 0, ((nBB * four_daysSDev) / four_daysDenom), 0);
    four_daysBBSIndLo = If (four_daysDenomLo <> 0, ((nBB * four_daysSDev) / four_daysDenomLo), 0);
    four_daysBBSIndHi = If (four_daysDenomHi <> 0, ((nBB * four_daysSDev) / four_daysDenomHi), 0);
    four_daysSqueeze = if four_daysBBSInd < AlertLine then 1 else 0;
    four_daysPreSqueeze = if four_daysBBSIndHi < AlertLine then 1 else 0;
    four_daysExtraSqueeze = if four_daysBBSIndLo < AlertLine then 1 else 0;
    Four_DayMinAggregationPeriod = 1;
}
else {
    four_daysPrice = 0;
    four_daysATR = 0;
    four_daysSDev = 0;
    four_daysDenom = 0;
    four_daysDenomLo = 0;
    four_daysDenomHi = 0;
    four_daysBBSInd = 0;
    four_daysBBSIndLo = 0;
    four_daysBBSIndHi = 0;
    four_daysSqueeze = 0;
    four_daysPreSqueeze = 0;
    four_daysExtraSqueeze = 0;
    Four_DayMinAggregationPeriod = 0;
}
AddLabel(FourDayLabel and Four_DayMinAggregationPeriod, "4D", if four_daysSqueeze then GlobalColor("Squeeze") else if four_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if four_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
# AddLabel(four_daysExtraSqueeze and four_daysAggregationPeriod, "W", globalColor("four_days Squeeze"));
# AddLabel(!four_daysSqueeze and four_daysAggregationPeriod,"W", globalColor("NO four_days Squeeze"));


def three_daysPrice;
def three_daysATR;
def three_daysSDev;
def three_daysDenom;
def three_daysDenomLo;
def three_daysDenomHi;
def three_daysBBSInd;
def three_daysBBSIndLo;
def three_daysBBSIndHi;
def three_daysSqueeze;
def three_daysPreSqueeze;
def three_daysExtraSqueeze;
def three_dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THREE_DAYS {
    three_daysPrice = close(period = "3 Days");
    three_daysATR = Average(TrueRange(high (period = "3 Days"), close(period = "3 Days"), low(period = "3 Days")), length);
    three_daysSDev = StDev(three_daysPrice, length);
    three_daysDenom = (nk * three_daysATR);
    three_daysDenomLo = (nkLo * three_daysATR);
    three_daysDenomHi = (nkHi * three_daysATR);
    three_daysBBSInd = If (three_daysDenom <> 0, ((nBB * three_daysSDev) / three_daysDenom), 0);
    three_daysBBSIndLo = If (three_daysDenomLo <> 0, ((nBB * three_daysSDev) / three_daysDenomLo), 0);
    three_daysBBSIndHi = If (three_daysDenomHi <> 0, ((nBB * three_daysSDev) / three_daysDenomHi), 0);
    three_daysSqueeze = if three_daysBBSInd < AlertLine then 1 else 0;
    three_daysPreSqueeze = if three_daysBBSIndHi < AlertLine then 1 else 0;
    three_daysExtraSqueeze = if three_daysBBSIndLo < AlertLine then 1 else 0;
    three_dayMinAggregationPeriod = 1;
}
else {
    three_daysPrice = 0;
    three_daysATR = 0;
    three_daysSDev = 0;
    three_daysDenom = 0;
    three_daysDenomLo = 0;
    three_daysDenomHi = 0;
    three_daysBBSInd = 0;
    three_daysBBSIndLo = 0;
    three_daysBBSIndHi = 0;
    three_daysSqueeze = 0;
    three_daysPreSqueeze = 0;
    three_daysExtraSqueeze = 0;
    three_dayMinAggregationPeriod = 0;
}
AddLabel(ThreeDayLabel and three_dayMinAggregationPeriod, "3D", if three_daysSqueeze then GlobalColor("Squeeze") else if three_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if three_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def two_daysPrice;
def two_daysATR;
def two_daysSDev;
def two_daysDenom;
def two_daysDenomLo;
def two_daysDenomHi;
def two_daysBBSInd;
def two_daysBBSIndLo;
def two_daysBBSIndHi;
def two_daysSqueeze;
def two_daysPreSqueeze;
def two_daysExtraSqueeze;
def two_dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWO_DAYS {
    two_daysPrice = close(period = "2 Days");
    two_daysATR = Average(TrueRange(high (period = "2 Days"), close(period = "2 Days"), low(period = "2 Days")), length);
    two_daysSDev = StDev(two_daysPrice, length);
    two_daysDenom = (nk * two_daysATR);
    two_daysDenomLo = (nkLo * two_daysATR);
    two_daysDenomHi = (nkHi * two_daysATR);
    two_daysBBSInd = If (two_daysDenom <> 0, ((nBB * two_daysSDev) / two_daysDenom), 0);
    two_daysBBSIndLo = If (two_daysDenomLo <> 0, ((nBB * two_daysSDev) / two_daysDenomLo), 0);
    two_daysBBSIndHi = If (two_daysDenomHi <> 0, ((nBB * two_daysSDev) / two_daysDenomHi), 0);
    two_daysSqueeze = if two_daysBBSInd < AlertLine then 1 else 0;
    two_daysPreSqueeze = if two_daysBBSIndHi < AlertLine then 1 else 0;
    two_daysExtraSqueeze = if two_daysBBSIndLo < AlertLine then 1 else 0;
    two_dayMinAggregationPeriod = 1;
}
else {
    two_daysPrice = 0;
    two_daysATR = 0;
    two_daysSDev = 0;
    two_daysDenom = 0;
    two_daysDenomLo = 0;
    two_daysDenomHi = 0;
    two_daysBBSInd = 0;
    two_daysBBSIndLo = 0;
    two_daysBBSIndHi = 0;
    two_daysSqueeze = 0;
    two_daysPreSqueeze = 0;
    two_daysExtraSqueeze = 0;
    two_dayMinAggregationPeriod = 0;
}
AddLabel(TwoDayLabel and two_dayMinAggregationPeriod, "2D", if two_daysSqueeze then GlobalColor("Squeeze") else if two_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if two_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def dayPrice;
def dayATR;
def daySDev;
def dayDenom;
def dayDenomLo;
def dayDenomHi;
def dayBBSInd;
def dayBBSIndLo;
def dayBBSIndHi;
def daySqueeze;
def dayPreSqueeze;
def dayExtraSqueeze;
def dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.DAY {
    dayPrice = close(period = "Day");
    dayATR = Average(TrueRange(high (period = "Day"), close(period = "Day"), low(period = "Day")), length);
    daySDev = StDev(dayPrice, length);
    dayDenom = (nk * dayATR);
    dayDenomLo = (nkLo * dayATR);
    dayDenomHi = (nkHi * dayATR);
    dayBBSInd = If (dayDenom <> 0, ((nBB * daySDev) / dayDenom), 0);
    dayBBSIndLo = If (dayDenomLo <> 0, ((nBB * daySDev) / dayDenomLo), 0);
    dayBBSIndHi = If (dayDenomHi <> 0, ((nBB * daySDev) / dayDenomHi), 0);
    daySqueeze = if dayBBSInd < AlertLine then 1 else 0;
    dayPreSqueeze = if dayBBSIndHi < AlertLine then 1 else 0;
    dayExtraSqueeze = if dayBBSIndLo < AlertLine then 1 else 0;
    dayMinAggregationPeriod = 1;
}
else {
    dayPrice = 0;
    dayATR = 0;
    daySDev = 0;
    dayDenom = 0;
    dayDenomLo = 0;
    dayDenomHi = 0;
    dayBBSInd = 0;
    dayBBSIndLo = 0;
    dayBBSIndHi = 0;
    daySqueeze = 0;
    dayPreSqueeze = 0;
    dayExtraSqueeze = 0;
    dayMinAggregationPeriod = 0;
}
AddLabel(DayLabel and dayMinAggregationPeriod, "D", if daySqueeze then GlobalColor("Squeeze") else if dayExtraSqueeze then GlobalColor("ExtraSqueeze") else if dayPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def four_hoursPrice;
def four_hoursATR;
def four_hoursSDev;
def four_hoursDenom;
def four_hoursDenomLo;
def four_hoursDenomHi;
def four_hoursBBSInd;
def four_hoursBBSIndLo;
def four_hoursBBSIndHi;
def four_hoursSqueeze;
def four_hoursPreSqueeze;
def four_hoursExtraSqueeze;
def FourHourMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_HOURS {
    four_hoursPrice = close(period = "4 Hours");
    four_hoursATR = Average(TrueRange(high (period = "4 Hours"), close(period = "4 Hours"), low(period = "4 Hours")), length);
    four_hoursSDev = StDev(four_hoursPrice, length);
    four_hoursDenom = (nk * four_hoursATR);
    four_hoursDenomLo = (nkLo * four_hoursATR);
    four_hoursDenomHi = (nkHi * four_hoursATR);
    four_hoursBBSInd = If (four_hoursDenom <> 0, ((nBB * four_hoursSDev) / four_hoursDenom), 0);
    four_hoursBBSIndLo = If (four_hoursDenomLo <> 0, ((nBB * four_hoursSDev) / four_hoursDenomLo), 0);
    four_hoursBBSIndHi = If (four_hoursDenomHi <> 0, ((nBB * four_hoursSDev) / four_hoursDenomHi), 0);
    four_hoursSqueeze = if four_hoursBBSInd < AlertLine then 1 else 0;
    four_hoursPreSqueeze = if four_hoursBBSIndHi < AlertLine then 1 else 0;
    four_hoursExtraSqueeze = if four_hoursBBSIndLo < AlertLine then 1 else 0;
    FourHourMinAggregationPeriod = 1;
}
else {
    four_hoursPrice = 0;
    four_hoursATR = 0;
    four_hoursSDev = 0;
    four_hoursDenom = 0;
    four_hoursDenomLo = 0;
    four_hoursDenomHi = 0;
    four_hoursBBSInd = 0;
    four_hoursBBSIndLo = 0;
    four_hoursBBSIndHi = 0;
    four_hoursSqueeze = 0;
    four_hoursPreSqueeze = 0;
    four_hoursExtraSqueeze = 0;
    FourHourMinAggregationPeriod = 0;
}
AddLabel(FourHourLabel and FourHourMinAggregationPeriod, "4h", if four_hoursSqueeze then GlobalColor("Squeeze") else if four_hoursPreSqueeze then GlobalColor("PreSqueeze") else if four_hoursExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("No Squeeze"));

def two_hoursPrice;
def two_hoursATR;
def two_hoursSDev;
def two_hoursDenom;
def two_hoursDenomLo;
def two_hoursDenomHi;
def two_hoursBBSInd;
def two_hoursBBSIndLo;
def two_hoursBBSIndHi;
def two_hoursSqueeze;
def two_hoursPreSqueeze;
def two_hoursExtraSqueeze;
def two_hoursMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.TWO_HOURS {
    two_hoursPrice = close(period = "2 Hours");
    two_hoursATR = Average(TrueRange(high (period = "2 Hours"), close(period = "2 Hours"), low(period = "2 Hours")), length);
    two_hoursSDev = StDev(two_hoursPrice, length);
    two_hoursDenom = (nk * two_hoursATR);
    two_hoursDenomLo = (nkLo * two_hoursATR);
    two_hoursDenomHi = (nkHi * two_hoursATR);
    two_hoursBBSInd = If (two_hoursDenom <> 0, ((nBB * two_hoursSDev) / two_hoursDenom), 0);
    two_hoursBBSIndLo = If (two_hoursDenomLo <> 0, ((nBB * two_hoursSDev) / two_hoursDenomLo), 0);
    two_hoursBBSIndHi = If (two_hoursDenomHi <> 0, ((nBB * two_hoursSDev) / two_hoursDenomHi), 0);
    two_hoursSqueeze = if two_hoursBBSInd < AlertLine then 1 else 0;
    two_hoursPreSqueeze = if two_hoursBBSIndHi < AlertLine then 1 else 0;
    two_hoursExtraSqueeze = if two_hoursBBSIndLo < AlertLine then 1 else 0;
    two_hoursMinAggregationPeriod = 1;
}
else {
    two_hoursPrice = 0;
    two_hoursATR = 0;
    two_hoursSDev = 0;
    two_hoursDenom = 0;
    two_hoursDenomLo = 0;
    two_hoursDenomHi = 0;
    two_hoursBBSInd = 0;
    two_hoursBBSIndLo = 0;
    two_hoursBBSIndHi = 0;
    two_hoursSqueeze = 0;
    two_hoursPreSqueeze = 0;
    two_hoursExtraSqueeze = 0;
    two_hoursMinAggregationPeriod = 0;
}
AddLabel(TwoHourLabel and two_hoursMinAggregationPeriod, "2h", if two_hoursPreSqueeze then GlobalColor("PreSqueeze") else if two_hoursSqueeze then GlobalColor("Squeeze" ) else if two_hoursExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("NO Squeeze"));

def hourPrice;
def hourATR;
def hourSDev;
def hourDenom;
def hourDenomLo;
def hourDenomHi;
def hourBBSInd;
def hourBBSIndLo;
def hourBBSIndHi;
def hourSqueeze;
def hourPreSqueeze;
def hourExtraSqueeze;
def HourMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.HOUR {
    hourPrice = close(period = "1 Hour");
    hourATR = Average(TrueRange(high (period = "1 Hour"), close(period = "1 Hour"), low(period = "1 Hour")), length);
    hourSDev = StDev(hourPrice, length);
    hourDenom = (nk * hourATR);
    hourDenomLo = (nkLo * hourATR);
    hourDenomHi = (nkHi * hourATR);
    hourBBSInd = If (hourDenom <> 0, ((nBB * hourSDev) / hourDenom), 0);
    hourBBSIndLo = If (hourDenomLo <> 0, ((nBB * hourSDev) / hourDenomLo), 0);
    hourBBSIndHi = If (hourDenomHi <> 0, ((nBB * hourSDev) / hourDenomHi), 0);
    hourSqueeze = if hourBBSInd < AlertLine then 1 else 0;
    hourPreSqueeze = if hourBBSIndHi < AlertLine then 1 else 0;
    hourExtraSqueeze = if hourBBSIndLo < AlertLine then 1 else 0;
    HourMinAggregationPeriod = 1;
}
else {
    hourPrice = 0;
    hourATR = 0;
    hourSDev = 0;
    hourDenom = 0;
    hourDenomLo = 0;
    hourDenomHi = 0;
    hourBBSInd = 0;
    hourBBSIndLo = 0;
    hourBBSIndHi = 0;
    hourSqueeze = 0;
    hourPreSqueeze = 0;
    hourExtraSqueeze = 0;
    HourMinAggregationPeriod = 0;
}
AddLabel(HourLabel and HourMinAggregationPeriod, "1h", if hourPreSqueeze then GlobalColor("PreSqueeze") else if hourSqueeze then GlobalColor("Squeeze" ) else if hourExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("NO Squeeze"));

def Thirty_MinPrice;
def Thirty_MinATR;
def Thirty_MinSDev;
def Thirty_MinDenom;
def Thirty_MinDenomLo;
def Thirty_MinDenomHi;
def Thirty_MinBBSInd;
def Thirty_MinBBSIndLo;
def Thirty_MinBBSIndHi;
def Thirty_MinSqueeze;
def Thirty_MinPreSqueeze;
def Thirty_MinExtraSqueeze;
def Thirty_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN {
    Thirty_MinPrice = close(period = "30 Min");
    Thirty_MinATR = Average(TrueRange(high (period = "30 Min"), close(period = "30 Min"), low(period = "30 Min")), length);
    Thirty_MinSDev = StDev(Thirty_MinPrice, length);
    Thirty_MinDenom = (nk * Thirty_MinATR);
    Thirty_MinDenomLo = (nkLo * Thirty_MinATR);
    Thirty_MinDenomHi = (nkHi * Thirty_MinATR);
    Thirty_MinBBSInd = If (Thirty_MinDenom <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenom), 0);
    Thirty_MinBBSIndLo = If (Thirty_MinDenomLo <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenomLo), 0);
    Thirty_MinBBSIndHi = If (Thirty_MinDenomHi <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenomHi), 0);
    Thirty_MinSqueeze = if Thirty_MinBBSInd < AlertLine then 1 else 0;
    Thirty_MinPreSqueeze = if Thirty_MinBBSIndHi < AlertLine then 1 else 0;
    Thirty_MinExtraSqueeze = if Thirty_MinBBSIndLo < AlertLine then 1 else 0;
    Thirty_MinAggregationPeriod = 1;
}
else {
    Thirty_MinPrice = 0;
    Thirty_MinATR = 0;
    Thirty_MinSDev = 0;
    Thirty_MinDenom = 0;
    Thirty_MinDenomLo = 0;
    Thirty_MinDenomHi = 0;
    Thirty_MinBBSInd = 0;
    Thirty_MinBBSIndLo = 0;
    Thirty_MinBBSIndHi = 0;
    Thirty_MinSqueeze = 0;
    Thirty_MinPreSqueeze = 0;
    Thirty_MinExtraSqueeze = 0;
    Thirty_MinAggregationPeriod = 0;
}
AddLabel(ThirtyMinLabel and Thirty_MinAggregationPeriod, "30m", if Thirty_MinSqueeze then GlobalColor("Squeeze") else if Thirty_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Thirty_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def Twenty_MinPrice;
def Twenty_MinATR;
def Twenty_MinSDev;
def Twenty_MinDenom;
def Twenty_MinDenomLo;
def Twenty_MinDenomHi;
def Twenty_MinBBSInd;
def Twenty_MinBBSIndLo;
def Twenty_MinBBSIndHi;
def Twenty_MinSqueeze;
def Twenty_MinPreSqueeze;
def Twenty_MinExtraSqueeze;
def Twenty_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWENTY_MIN {
    Twenty_MinPrice = close(period = "20 Min");
    Twenty_MinATR = Average(TrueRange(high (period = "20 Min"), close(period = "20 Min"), low(period = "20 Min")), length);
    Twenty_MinSDev = StDev(Twenty_MinPrice, length);
    Twenty_MinDenom = (nk * Twenty_MinATR);
    Twenty_MinDenomLo = (nkLo * Twenty_MinATR);
    Twenty_MinDenomHi = (nkHi * Twenty_MinATR);
    Twenty_MinBBSInd = If (Twenty_MinDenom <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenom), 0);
    Twenty_MinBBSIndLo = If (Twenty_MinDenomLo <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenomLo), 0);
    Twenty_MinBBSIndHi = If (Twenty_MinDenomHi <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenomHi), 0);
    Twenty_MinSqueeze = if Twenty_MinBBSInd < AlertLine then 1 else 0;
    Twenty_MinPreSqueeze = if Twenty_MinBBSIndHi < AlertLine then 1 else 0;
    Twenty_MinExtraSqueeze = if Twenty_MinBBSIndLo < AlertLine then 1 else 0;
    Twenty_MinAggregationPeriod = 1;
}
else {
    Twenty_MinPrice = 0;
    Twenty_MinATR = 0;
    Twenty_MinSDev = 0;
    Twenty_MinDenom = 0;
    Twenty_MinDenomLo = 0;
    Twenty_MinDenomHi = 0;
    Twenty_MinBBSInd = 0;
    Twenty_MinBBSIndLo = 0;
    Twenty_MinBBSIndHi = 0;
    Twenty_MinSqueeze = 0;
    Twenty_MinPreSqueeze = 0;
    Twenty_MinExtraSqueeze = 0;
    Twenty_MinAggregationPeriod = 0;
}
AddLabel(TwentyMinLabel and Twenty_MinAggregationPeriod, "20m", if Twenty_MinSqueeze then GlobalColor("Squeeze") else if Twenty_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Twenty_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def Fifteen_MinPrice;
def Fifteen_MinATR;
def Fifteen_MinSDev;
def Fifteen_MinDenom;
def Fifteen_MinDenomLo;
def Fifteen_MinDenomHi;
def Fifteen_MinBBSInd;
def Fifteen_MinBBSIndLo;
def Fifteen_MinBBSIndHi;
def Fifteen_MinSqueeze;
def Fifteen_MinPreSqueeze;
def Fifteen_MinExtraSqueeze;
def Fifteen_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN {
    Fifteen_MinPrice = close(period = "15 Min");
    Fifteen_MinATR = Average(TrueRange(high (period = "15 Min"), close(period = "15 Min"), low(period = "15 Min")), length);
    Fifteen_MinSDev = StDev(Fifteen_MinPrice, length);
    Fifteen_MinDenom = (nk * Fifteen_MinATR);
    Fifteen_MinDenomLo = (nkLo * Fifteen_MinATR);
    Fifteen_MinDenomHi = (nkHi * Fifteen_MinATR);
    Fifteen_MinBBSInd = If (Fifteen_MinDenom <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenom), 0);
    Fifteen_MinBBSIndLo = If (Fifteen_MinDenomLo <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenomLo), 0);
    Fifteen_MinBBSIndHi = If (Fifteen_MinDenomHi <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenomHi), 0);
    Fifteen_MinSqueeze = if Fifteen_MinBBSInd < AlertLine then 1 else 0;
    Fifteen_MinPreSqueeze = if Fifteen_MinBBSIndHi < AlertLine then 1 else 0;
    Fifteen_MinExtraSqueeze = if Fifteen_MinBBSIndLo < AlertLine then 1 else 0;
    Fifteen_MinAggregationPeriod = 1;
}
else {
    Fifteen_MinPrice = 0;
    Fifteen_MinATR = 0;
    Fifteen_MinSDev = 0;
    Fifteen_MinDenom = 0;
    Fifteen_MinDenomLo = 0;
    Fifteen_MinDenomHi = 0;
    Fifteen_MinBBSInd = 0;
    Fifteen_MinBBSIndLo = 0;
    Fifteen_MinBBSIndHi = 0;
    Fifteen_MinSqueeze = 0;
    Fifteen_MinPreSqueeze = 0;
    Fifteen_MinExtraSqueeze = 0;
    Fifteen_MinAggregationPeriod = 0;
}
AddLabel(FifteenMinLabel and Fifteen_MinAggregationPeriod, "15m", if Fifteen_MinSqueeze then GlobalColor("Squeeze") else if Fifteen_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Fifteen_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def ten_minPrice;
def ten_minATR;
def ten_minSDev;
def ten_minDenom;
def ten_minDenomLo;
def ten_minDenomHi;
def ten_minBBSInd;
def ten_minBBSIndLo;
def ten_minBBSIndHi;
def ten_minSqueeze;
def ten_minPreSqueeze;
def ten_minExtraSqueeze;
def ten_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TEN_MIN {
    ten_minPrice = close(period = "10 Min");
    ten_minATR = Average(TrueRange(high (period = "10 Min"), close(period = "10 Min"), low(period = "10 Min")), length);
    ten_minSDev = StDev(ten_minPrice, length);
    ten_minDenom = (nk * ten_minATR);
    ten_minDenomLo = (nkLo * ten_minATR);
    ten_minDenomHi = (nkHi * ten_minATR);
    ten_minBBSInd = If (ten_minDenom <> 0, ((nBB * ten_minSDev) / ten_minDenom), 0);
    ten_minBBSIndLo = If (ten_minDenomLo <> 0, ((nBB * ten_minSDev) / ten_minDenomLo), 0);
    ten_minBBSIndHi = If (ten_minDenomHi <> 0, ((nBB * ten_minSDev) / ten_minDenomHi), 0);
    ten_minSqueeze = if ten_minBBSInd < AlertLine then 1 else 0;
    ten_minPreSqueeze = if ten_minBBSIndHi < AlertLine then 1 else 0;
    ten_minExtraSqueeze = if ten_minBBSIndLo < AlertLine then 1 else 0;
    ten_minAggregationPeriod = 1;
}
else {
    ten_minPrice = 0;
    ten_minATR = 0;
    ten_minSDev = 0;
    ten_minDenom = 0;
    ten_minDenomLo = 0;
    ten_minDenomHi = 0;
    ten_minBBSInd = 0;
    ten_minBBSIndLo = 0;
    ten_minBBSIndHi = 0;
    ten_minSqueeze = 0;
    ten_minPreSqueeze = 0;
    ten_minExtraSqueeze = 0;
    ten_minAggregationPeriod = 0;
}
AddLabel(TenMinLabel and ten_minAggregationPeriod, "10m", if ten_minSqueeze then GlobalColor("Squeeze") else if ten_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if ten_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def five_minPrice;
def five_minATR;
def five_minSDev;
def five_minDenom;
def five_minDenomLo;
def five_minDenomHi;
def five_minBBSInd;
def five_minBBSIndLo;
def five_minBBSIndHi;
def five_minSqueeze;
def five_minPreSqueeze;
def five_minExtraSqueeze;
def five_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN {
    five_minPrice = close(period = "5 Min");
    five_minATR = Average(TrueRange(high (period = "5 Min"), close(period = "5 Min"), low(period = "5 Min")), length);
    five_minSDev = StDev(five_minPrice, length);
    five_minDenom = (nk * five_minATR);
    five_minDenomLo = (nkLo * five_minATR);
    five_minDenomHi = (nkHi * five_minATR);
    five_minBBSInd = If (five_minDenom <> 0, ((nBB * five_minSDev) / five_minDenom), 0);
    five_minBBSIndLo = If (five_minDenomLo <> 0, ((nBB * five_minSDev) / five_minDenomLo), 0);
    five_minBBSIndHi = If (five_minDenomHi <> 0, ((nBB * five_minSDev) / five_minDenomHi), 0);
    five_minSqueeze = if five_minBBSInd < AlertLine then 1 else 0;
    five_minPreSqueeze = if five_minBBSIndHi < AlertLine then 1 else 0;
    five_minExtraSqueeze = if five_minBBSIndLo < AlertLine then 1 else 0;
    five_minAggregationPeriod = 1;
}
else {
    five_minPrice = 0;
    five_minATR = 0;
    five_minSDev = 0;
    five_minDenom = 0;
    five_minDenomLo = 0;
    five_minDenomHi = 0;
    five_minBBSInd = 0;
    five_minBBSIndLo = 0;
    five_minBBSIndHi = 0;
    five_minSqueeze = 0;
    five_minPreSqueeze = 0;
    five_minExtraSqueeze = 0;
    five_minAggregationPeriod = 0;
}
AddLabel(FiveMinLabel and five_minAggregationPeriod, "5m", if five_minSqueeze then GlobalColor("Squeeze") else if five_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if five_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def four_minPrice;
def four_minATR;
def four_minSDev;
def four_minDenom;
def four_minDenomLo;
def four_minDenomHi;
def four_minBBSInd;
def four_minBBSIndLo;
def four_minBBSIndHi;
def four_minSqueeze;
def four_minPreSqueeze;
def four_minExtraSqueeze;
def four_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FOUR_MIN {
    four_minPrice = close(period = "4 Min");
    four_minATR = Average(TrueRange(high (period = "4 Min"), close(period = "4 Min"), low(period = "4 Min")), length);
    four_minSDev = StDev(four_minPrice, length);
    four_minDenom = (nk * four_minATR);
    four_minDenomLo = (nkLo * four_minATR);
    four_minDenomHi = (nkHi * four_minATR);
    four_minBBSInd = If (four_minDenom <> 0, ((nBB * four_minSDev) / four_minDenom), 0);
    four_minBBSIndLo = If (four_minDenomLo <> 0, ((nBB * four_minSDev) / four_minDenomLo), 0);
    four_minBBSIndHi = If (four_minDenomHi <> 0, ((nBB * four_minSDev) / four_minDenomHi), 0);
    four_minSqueeze = if four_minBBSInd < AlertLine then 1 else 0;
    four_minPreSqueeze = if four_minBBSIndHi < AlertLine then 1 else 0;
    four_minExtraSqueeze = if four_minBBSIndLo < AlertLine then 1 else 0;
    four_minAggregationPeriod = 1;
}
else {
    four_minPrice = 0;
    four_minATR = 0;
    four_minSDev = 0;
    four_minDenom = 0;
    four_minDenomLo = 0;
    four_minDenomHi = 0;
    four_minBBSInd = 0;
    four_minBBSIndLo = 0;
    four_minBBSIndHi = 0;
    four_minSqueeze = 0;
    four_minPreSqueeze = 0;
    four_minExtraSqueeze = 0;
    four_minAggregationPeriod = 0;
}
AddLabel(FourMinLabel and four_minAggregationPeriod, "4m", if four_minSqueeze then GlobalColor("Squeeze") else if four_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if four_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def three_minPrice;
def three_minATR;
def three_minSDev;
def three_minDenom;
def three_minDenomLo;
def three_minDenomHi;
def three_minBBSInd;
def three_minBBSIndLo;
def three_minBBSIndHi;
def three_minSqueeze;
def three_minPreSqueeze;
def three_minExtraSqueeze;
def three_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THREE_MIN {
    three_minPrice = close(period = "3 Min");
    three_minATR = Average(TrueRange(high (period = "3 Min"), close(period = "3 Min"), low(period = "3 Min")), length);
    three_minSDev = StDev(three_minPrice, length);
    three_minDenom = (nk * three_minATR);
    three_minDenomLo = (nkLo * three_minATR);
    three_minDenomHi = (nkHi * three_minATR);
    three_minBBSInd = If (three_minDenom <> 0, ((nBB * three_minSDev) / three_minDenom), 0);
    three_minBBSIndLo = If (three_minDenomLo <> 0, ((nBB * three_minSDev) / three_minDenomLo), 0);
    three_minBBSIndHi = If (three_minDenomHi <> 0, ((nBB * three_minSDev) / three_minDenomHi), 0);
    three_minSqueeze = if three_minBBSInd < AlertLine then 1 else 0;
    three_minPreSqueeze = if three_minBBSIndHi < AlertLine then 1 else 0;
    three_minExtraSqueeze = if three_minBBSIndLo < AlertLine then 1 else 0;
    three_minAggregationPeriod = 1;
}
else {
    three_minPrice = 0;
    three_minATR = 0;
    three_minSDev = 0;
    three_minDenom = 0;
    three_minDenomLo = 0;
    three_minDenomHi = 0;
    three_minBBSInd = 0;
    three_minBBSIndLo = 0;
    three_minBBSIndHi = 0;
    three_minSqueeze = 0;
    three_minPreSqueeze = 0;
    three_minExtraSqueeze = 0;
    three_minAggregationPeriod = 0;
}
AddLabel(ThreeMinLabel and three_minAggregationPeriod, "3m", if three_minSqueeze then GlobalColor("Squeeze") else if three_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if three_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def two_minPrice;
def two_minATR;
def two_minSDev;
def two_minDenom;
def two_minDenomLo;
def two_minDenomHi;
def two_minBBSInd;
def two_minBBSIndLo;
def two_minBBSIndHi;
def two_minSqueeze;
def two_minPreSqueeze;
def two_minExtraSqueeze;
def two_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWO_MIN {
    two_minPrice = close(period = "2 Min");
    two_minATR = Average(TrueRange(high (period = "2 Min"), close(period = "2 Min"), low(period = "2 Min")), length);
    two_minSDev = StDev(two_minPrice, length);
    two_minDenom = (nk * two_minATR);
    two_minDenomLo = (nkLo * two_minATR);
    two_minDenomHi = (nkHi * two_minATR);
    two_minBBSInd = If (two_minDenom <> 0, ((nBB * two_minSDev) / two_minDenom), 0);
    two_minBBSIndLo = If (two_minDenomLo <> 0, ((nBB * two_minSDev) / two_minDenomLo), 0);
    two_minBBSIndHi = If (two_minDenomHi <> 0, ((nBB * two_minSDev) / two_minDenomHi), 0);
    two_minSqueeze = if two_minBBSInd < AlertLine then 1 else 0;
    two_minPreSqueeze = if two_minBBSIndHi < AlertLine then 1 else 0;
    two_minExtraSqueeze = if two_minBBSIndLo < AlertLine then 1 else 0;
    two_minAggregationPeriod = 1;
}
else {
    two_minPrice = 0;
    two_minATR = 0;
    two_minSDev = 0;
    two_minDenom = 0;
    two_minDenomLo = 0;
    two_minDenomHi = 0;
    two_minBBSInd = 0;
    two_minBBSIndLo = 0;
    two_minBBSIndHi = 0;
    two_minSqueeze = 0;
    two_minPreSqueeze = 0;
    two_minExtraSqueeze = 0;
    two_minAggregationPeriod = 0;
}
AddLabel(TwoMinLabel and two_minAggregationPeriod, "2m", if two_minSqueeze then GlobalColor("Squeeze") else if two_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if two_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def one_minPrice;
def one_minATR;
def one_minSDev;
def one_minDenom;
def one_minDenomLo;
def one_minDenomHi;
def one_minBBSInd;
def one_minBBSIndLo;
def one_minBBSIndHi;
def one_minSqueeze;
def one_minPreSqueeze;
def one_minExtraSqueeze;
def one_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.MIN {
    one_minPrice = close(period = "1 Min");
    one_minATR = Average(TrueRange(high (period = "1 Min"), close(period = "1 Min"), low(period = "1 Min")), length);
    one_minSDev = StDev(one_minPrice, length);
    one_minDenom = (nk * one_minATR);
    one_minDenomLo = (nkLo * one_minATR);
    one_minDenomHi = (nkHi * one_minATR);
    one_minBBSInd = If (one_minDenom <> 0, ((nBB * one_minSDev) / one_minDenom), 0);
    one_minBBSIndLo = If (one_minDenomLo <> 0, ((nBB * one_minSDev) / one_minDenomLo), 0);
    one_minBBSIndHi = If (one_minDenomHi <> 0, ((nBB * one_minSDev) / one_minDenomHi), 0);
    one_minSqueeze = if one_minBBSInd < AlertLine then 1 else 0;
    one_minPreSqueeze = if one_minBBSIndHi < AlertLine then 1 else 0;
    one_minExtraSqueeze = if one_minBBSIndLo < AlertLine then 1 else 0;
    one_minAggregationPeriod = 1;
}
else {
    one_minPrice = 0;
    one_minATR = 0;
    one_minSDev = 0;
    one_minDenom = 0;
    one_minDenomLo = 0;
    one_minDenomHi = 0;
    one_minBBSInd = 0;
    one_minBBSIndLo = 0;
    one_minBBSIndHi = 0;
    one_minSqueeze = 0;
    one_minPreSqueeze = 0;
    one_minExtraSqueeze = 0;
    one_minAggregationPeriod = 0;
}
AddLabel(OneMinLabel and one_minAggregationPeriod, "1m", if one_minSqueeze then GlobalColor("Squeeze") else if one_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if one_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
 
Last edited:
can we make scanner that can scan the stock before squeeze fire.and watch list column.
if we can find 10min 30min d and w and M squeeze ok
thanks for sharing this.
 
Thanks Casey for taking the time to create and post this MTF labeler. It is awesome. Quick question. On all charts, I never see the 4d, W, or M timeframes. They are all black. Is it possible there is a setting on my end preventing these timeframes?

MTFMW4D.jpg
 
I’m glad you like it! So long as you copied and pasted the code then - no, there shouldn’t be any settings on your end messing anything up. My first thought is, what stocks are you trying to look up when the labels are black? I’m asking because, depending on the stocks, there might not be enough data on the stocks for the labels to work (ex. If the stocks IPO’d recently then there won’t be enough market time for the labels to populate).
 
Thank you for your feedback! Here is what I tested...

I reset ToS to the default workspace - just to baseline the app. Re-copied (above) and pasted the code into a new study. I have tried several long term tickers, but for example I am looking at TSLA and AAPL right now. If I select a 1 Hour chart, all labels from 1 Hour to Monthly show (works perfectly). However, if I choose 30m chart, I see 30m to Weekly labels (monthly is black). If I choose a 5m chart, I see 5m to Weekly labels (Monthly is black). If I choose a 1m chart, I see 1m to 3D (but 4D, W, and M are black) - see snapshot of TSLA below. This only seems to occur using a 15m or less chart.

Just so I am not crazy, I tried it on a different trading computer / different instance of ToS (both computers have 64Gb of RAM). I am curious if anyone else is experiencing the same issue? Example of TSLA (image) is below - 4D, W, and M are missing. Thanks all! I love this script - I just can't figure out what I might be doing wrong.

MTFMW4D.jpg
 
Thank you for your feedback! Here is what I tested...

I reset ToS to the default workspace - just to baseline the app. Re-copied (above) and pasted the code into a new study. I have tried several long term tickers, but for example I am looking at TSLA and AAPL right now. If I select a 1 Hour chart, all labels from 1 Hour to Monthly show (works perfectly). However, if I choose 30m chart, I see 30m to Weekly labels (monthly is black). If I choose a 5m chart, I see 5m to Weekly labels (Monthly is black). If I choose a 1m chart, I see 1m to 3D (but 4D, W, and M are black) - see snapshot of TSLA below. This only seems to occur using a 15m or less chart.

Just so I am not crazy, I tried it on a different trading computer / different instance of ToS (both computers have 64Gb of RAM). I am curious if anyone else is experiencing the same issue? Example of TSLA (image) is below - 4D, W, and M are missing. Thanks all! I love this script - I just can't figure out what I might be doing wrong.

MTFMW4D.jpg
Hmm. That is very strange. Coincidentally, I was looking at TSLA earlier today. I only have those 2 scripts loaded onto 1 chart in a 4 grid. It’s Always set to 30D:1m. Anyhow, when I was looking at TSLA earlier, all labels were colored properly. I’m currently on the road but I will take a look at the script I posted on the thread to ensure it’s correct. I’ll have to get back to you. I have a funny feeling I posted the incorrect script when I attempted to post the correct, fixed script. The issue I was experiencing prior to fixing was somewhat similar. Not all labels would populate a color and when I changed timeframes, the labels would change different colors which definitely wasn’t right. I’ll do some research later and get back to you. I’m also curious to know if anybody else is experiencing issues!
 
Thank you for your feedback! Here is what I tested...

I reset ToS to the default workspace - just to baseline the app. Re-copied (above) and pasted the code into a new study. I have tried several long term tickers, but for example I am looking at TSLA and AAPL right now. If I select a 1 Hour chart, all labels from 1 Hour to Monthly show (works perfectly). However, if I choose 30m chart, I see 30m to Weekly labels (monthly is black). If I choose a 5m chart, I see 5m to Weekly labels (Monthly is black). If I choose a 1m chart, I see 1m to 3D (but 4D, W, and M are black) - see snapshot of TSLA below. This only seems to occur using a 15m or less chart.

Just so I am not crazy, I tried it on a different trading computer / different instance of ToS (both computers have 64Gb of RAM). I am curious if anyone else is experiencing the same issue? Example of TSLA (image) is below - 4D, W, and M are missing. Thanks all! I love this script - I just can't figure out what I might be doing wrong.

MTFMW4D.jpg
Something that just came to mind - what do you have TOS allocated memory set to? Perhaps it’s too low for the entirety of the long scripts to be able to run? I don’t think that’s it, but worth ruling out at least. I’m assuming you also didn’t add any other studies (or at least only 1 or 2) when testing again and when you took the TSLA screenshot above?

For shits and giggles, only load EITHER the MTF Squeeze Pro Labels OR the MTF Squeeze Histogram Labels to a chart. See if all timeframe labels load properly then. Also, feel free to email me about this instead. It’ll be quicker. [email protected]
 
Casey - sorry! I just figured it out... if anyone has a similar problem - just change the timeframe to 1 minutes : 30 days. That was my problem. My chart was set to 1 minute : 1 day. Again, thanks for an awesome script!!
 
Thank you for your feedback! Here is what I tested...

I reset ToS to the default workspace - just to baseline the app. Re-copied (above) and pasted the code into a new study. I have tried several long term tickers, but for example I am looking at TSLA and AAPL right now. If I select a 1 Hour chart, all labels from 1 Hour to Monthly show (works perfectly). However, if I choose 30m chart, I see 30m to Weekly labels (monthly is black). If I choose a 5m chart, I see 5m to Weekly labels (Monthly is black). If I choose a 1m chart, I see 1m to 3D (but 4D, W, and M are black) - see snapshot of TSLA below. This only seems to occur using a 15m or less chart.

Just so I am not crazy, I tried it on a different trading computer / different instance of ToS (both computers have 64Gb of RAM). I am curious if anyone else is experiencing the same issue? Example of TSLA (image) is below - 4D, W, and M are missing. Thanks all! I love this script - I just can't figure out what I might be doing wrong.
Casey - sorry! I just figured it out... if anyone has a similar problem - just change the timeframe to 1 minutes : 30 days. That was my problem. My chart was set to 1 minute : 1 day. Again, thanks for an awesome script!!
You’re very welcome for the script! I’m very glad that other people find it useful - makes the effort writing the script all the more worth it!

Oh that’s an odd timeframe. I still don’t understand why those particular time frame labels (M, W, 4D) wouldn’t work properly on that timeframe. The only part of the script that the timeframe interacts with is the “AddLabel” function which, in layman’s terms, says, “if the chart’s aggregation period is less than or equal to the label’s aggregation period, then show the label(s) on the chart.”

Interesting discovery. I’m going to have to figure out why that’s the case now or it’s going to drive me nuts. If anybody knows why this is happening please comment!
 
Haha! Funny you mention that — I watched his webinar last night and was wondering exactly that. My best guess as of now would be that it’s based off of some MACD variant as well as a momentum indicator and possibly a trend indicator (think like ADX, SAR, or Sentiment). He did not explain much into detail about it AT ALL. From my recollection, he basically only said that it shows the trend (ahead of price). I’m assuming it’s the HiLowPro you’re talking about? It’s not even listed on their site and a google search pulls nothing.

I do have the “Precious Day High and Low Breakout Indicator” that you can find on this site. That’s another thing Sam discussed last night. If you’re interested in the “10X Bars”, I also made a version of those as well as MTF Stacked EMA’s labels.

For the meantime, I'd recommend this trend reversal indicator. I've been using it but haven't yet implemented it. Meaning - I have yet to make a trade based on the first painted chart bubble alerting me of a reversal. That's the downside to most trend indicators (Sam Shames' included) they repaint. If you aren't familiar with what that is, it means that - the indicator may show a chart bubble that states the trend is reversing to the upside at 10am. For this hypothetical, let's say you're using a 1 min. chart. After a few bars close and the price stays stagnant or reverses to the downside, that chart bubble will either disappear or turn violet (indicating it's a "neutral" reversal). I specifically asked in the chat last night if the indicator repaints. Lorna replied that it does. Funny how that wasn't ONCE mentioned by Sam...
 
Last edited:
Here is the script I wrote for MTF (Multi Time Frame) Squeeze Pro Labels. Just to be clear, this is NOT the same as my MTF Squeeze HISTOGRAM Labels. These labels change colors based on the presence/absence of a squeeze. If there's an original squeeze, the label's red, if there's a "Pre-Squeeze" the label's orange, if there's an "Extra-Squeeze" the label's yellow, and if there's no squeeze, the label's green. Per a recent comment under my MTF Squeeze HISTOGRAM Labels thread, I have revised this script (1/5/2022). This script is more succinct with the Global Colors. More importantly, you are now able to turn on/off any time frames that you do not wish to be displayed on your chart(s). Enjoy!
Code:
#MTF SQUEEZE PRO LABELS
#BY: CASEY BRETT WITH THE USE OF CODE FROM: TOS Indicators

##Global Variables
input length = 20;
def AlertLine = 1;
input nk = 1.5;
input nkHi = 2;
input nkLo = 1;
def nBB = 2;
input averageType = AverageType.EXPONENTIAL;
def displace = 0;
input trueRangeAverageType = AverageType.SIMPLE;


input MonthLabel = yes;
input WeekLabel = yes;
input FourDayLabel = yes;
input ThreeDayLabel = yes;
input TwoDayLabel = yes;
input DayLabel = yes;
input FourHourLabel = yes;
input TwoHourLabel = yes;
input HourLabel = yes;
input ThirtyMinLabel = yes;
input TwentyMinLabel = yes;
input FifteenMinLabel = yes;
input TenMinLabel = yes;
input FiveMinLabel = yes;
input FourMinLabel = yes;
input ThreeMinLabel = yes;
input TwoMinLabel = yes;
input OneMinLabel = yes;


DefineGlobalColor("Squeeze", Color.RED);
DefineGlobalColor("PreSqueeze", Color.ORANGE);
DefineGlobalColor("ExtraSqueeze", Color.YELLOW);
DefineGlobalColor("NO Squeeze", Color.DARK_GREEN);

## Month Aggregation Period Variables

def monthPrice;
def monthATR;
def monthSDev;
def monthDenom;
def monthDenomLo;
def monthDenomHi;
def monthBBSInd;
def monthBBSIndLo;
def monthBBSIndHi;
def monthSqueeze;
def monthPreSqueeze;
def monthExtraSqueeze;
def monthAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.MONTH {
    monthPrice = close(period = "Month");
    monthATR = Average(TrueRange(high (period = "Month"), close(period = "Month"), low(period = "Month")), length);
    monthSDev = StDev(monthPrice, length);
    monthDenom = (nk * monthATR);
    monthDenomLo = (nkLo * monthATR);
    monthDenomHi = (nkHi * monthATR);
    monthBBSInd = If (monthDenom <> 0, ((nBB * monthSDev) / monthDenom), 0);
    monthBBSIndLo = If (monthDenomLo <> 0, ((nBB * monthSDev) / monthDenomLo), 0);
    monthBBSIndHi = If (monthDenomHi <> 0, ((nBB * monthSDev) / monthDenomHi), 0);
    monthSqueeze = if monthBBSInd < AlertLine then 1 else 0;
    monthPreSqueeze = if monthBBSIndHi < AlertLine then 1 else 0;
    monthExtraSqueeze = if monthBBSIndLo < AlertLine then 1 else 0;
    monthAggregationPeriod = 1;
}
else {
    monthPrice = 0;
    monthATR = 0;
    monthSDev = 0;
    monthDenom = 0;
    monthDenomLo = 0;
    monthDenomHi = 0;
    monthBBSInd = 0;
    monthBBSIndLo = 0;
    monthBBSIndHi = 0;
    monthSqueeze = 0;
    monthPreSqueeze = 0;
    monthExtraSqueeze = 0;
    monthAggregationPeriod = 0;
}
AddLabel(MonthLabel and monthAggregationPeriod, "M", if monthSqueeze then GlobalColor("Squeeze") else if monthExtraSqueeze then GlobalColor("ExtraSqueeze") else if monthPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def weekPrice;
def weekATR;
def weekSDev;
def weekDenom;
def weekDenomLo;
def weekDenomHi;
def weekBBSInd;
def weekBBSIndLo;
def weekBBSIndHi;
def weekSqueeze;
def weekPreSqueeze;
def weekExtraSqueeze;
def WeekAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.WEEK {
    weekPrice = close(period = "week");
    weekATR = Average(TrueRange(high (period = "week"), close(period = "week"), low(period = "week")), length);
    weekSDev = StDev(weekPrice, length);
    weekDenom = (nk * weekATR);
    weekDenomLo = (nkLo * weekATR);
    weekDenomHi = (nkHi * weekATR);
    weekBBSInd = If (weekDenom <> 0, ((nBB * weekSDev) / weekDenom), 0);
    weekBBSIndLo = If (weekDenomLo <> 0, ((nBB * weekSDev) / weekDenomLo), 0);
    weekBBSIndHi = If (weekDenomHi <> 0, ((nBB * weekSDev) / weekDenomHi), 0);
    weekSqueeze = if weekBBSInd < AlertLine then 1 else 0;
    weekPreSqueeze = if weekBBSIndHi < AlertLine then 1 else 0;
    weekExtraSqueeze = if weekBBSIndLo < AlertLine then 1 else 0;
    WeekAggregationPeriod = 1;
}
else {
    weekPrice = 0;
    weekATR = 0;
    weekSDev = 0;
    weekDenom = 0;
    weekDenomLo = 0;
    weekDenomHi = 0;
    weekBBSInd = 0;
    weekBBSIndLo = 0;
    weekBBSIndHi = 0;
    weekSqueeze = 0;
    weekPreSqueeze = 0;
    weekExtraSqueeze = 0;
    WeekAggregationPeriod = 0;
}
AddLabel(WeekLabel and WeekAggregationPeriod, "W", if weekSqueeze then GlobalColor("Squeeze") else if weekExtraSqueeze then GlobalColor("ExtraSqueeze") else if weekPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
# AddLabel(weekExtraSqueeze and weekAggregationPeriod, "W", globalColor("week Squeeze"));
# AddLabel(!weekSqueeze and weekAggregationPeriod,"W", globalColor("NO week Squeeze"));


def four_daysPrice;
def four_daysATR;
def four_daysSDev;
def four_daysDenom;
def four_daysDenomLo;
def four_daysDenomHi;
def four_daysBBSInd;
def four_daysBBSIndLo;
def four_daysBBSIndHi;
def four_daysSqueeze;
def four_daysPreSqueeze;
def four_daysExtraSqueeze;
def Four_DayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FOUR_DAYS {
    four_daysPrice = close(period = "4 Days");
    four_daysATR = Average(TrueRange(high (period = "4 Days"), close(period = "4 Days"), low(period = "4 Days")), length);
    four_daysSDev = StDev(four_daysPrice, length);
    four_daysDenom = (nk * four_daysATR);
    four_daysDenomLo = (nkLo * four_daysATR);
    four_daysDenomHi = (nkHi * four_daysATR);
    four_daysBBSInd = If (four_daysDenom <> 0, ((nBB * four_daysSDev) / four_daysDenom), 0);
    four_daysBBSIndLo = If (four_daysDenomLo <> 0, ((nBB * four_daysSDev) / four_daysDenomLo), 0);
    four_daysBBSIndHi = If (four_daysDenomHi <> 0, ((nBB * four_daysSDev) / four_daysDenomHi), 0);
    four_daysSqueeze = if four_daysBBSInd < AlertLine then 1 else 0;
    four_daysPreSqueeze = if four_daysBBSIndHi < AlertLine then 1 else 0;
    four_daysExtraSqueeze = if four_daysBBSIndLo < AlertLine then 1 else 0;
    Four_DayMinAggregationPeriod = 1;
}
else {
    four_daysPrice = 0;
    four_daysATR = 0;
    four_daysSDev = 0;
    four_daysDenom = 0;
    four_daysDenomLo = 0;
    four_daysDenomHi = 0;
    four_daysBBSInd = 0;
    four_daysBBSIndLo = 0;
    four_daysBBSIndHi = 0;
    four_daysSqueeze = 0;
    four_daysPreSqueeze = 0;
    four_daysExtraSqueeze = 0;
    Four_DayMinAggregationPeriod = 0;
}
AddLabel(FourDayLabel and Four_DayMinAggregationPeriod, "4D", if four_daysSqueeze then GlobalColor("Squeeze") else if four_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if four_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
# AddLabel(four_daysExtraSqueeze and four_daysAggregationPeriod, "W", globalColor("four_days Squeeze"));
# AddLabel(!four_daysSqueeze and four_daysAggregationPeriod,"W", globalColor("NO four_days Squeeze"));


def three_daysPrice;
def three_daysATR;
def three_daysSDev;
def three_daysDenom;
def three_daysDenomLo;
def three_daysDenomHi;
def three_daysBBSInd;
def three_daysBBSIndLo;
def three_daysBBSIndHi;
def three_daysSqueeze;
def three_daysPreSqueeze;
def three_daysExtraSqueeze;
def three_dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THREE_DAYS {
    three_daysPrice = close(period = "3 Days");
    three_daysATR = Average(TrueRange(high (period = "3 Days"), close(period = "3 Days"), low(period = "3 Days")), length);
    three_daysSDev = StDev(three_daysPrice, length);
    three_daysDenom = (nk * three_daysATR);
    three_daysDenomLo = (nkLo * three_daysATR);
    three_daysDenomHi = (nkHi * three_daysATR);
    three_daysBBSInd = If (three_daysDenom <> 0, ((nBB * three_daysSDev) / three_daysDenom), 0);
    three_daysBBSIndLo = If (three_daysDenomLo <> 0, ((nBB * three_daysSDev) / three_daysDenomLo), 0);
    three_daysBBSIndHi = If (three_daysDenomHi <> 0, ((nBB * three_daysSDev) / three_daysDenomHi), 0);
    three_daysSqueeze = if three_daysBBSInd < AlertLine then 1 else 0;
    three_daysPreSqueeze = if three_daysBBSIndHi < AlertLine then 1 else 0;
    three_daysExtraSqueeze = if three_daysBBSIndLo < AlertLine then 1 else 0;
    three_dayMinAggregationPeriod = 1;
}
else {
    three_daysPrice = 0;
    three_daysATR = 0;
    three_daysSDev = 0;
    three_daysDenom = 0;
    three_daysDenomLo = 0;
    three_daysDenomHi = 0;
    three_daysBBSInd = 0;
    three_daysBBSIndLo = 0;
    three_daysBBSIndHi = 0;
    three_daysSqueeze = 0;
    three_daysPreSqueeze = 0;
    three_daysExtraSqueeze = 0;
    three_dayMinAggregationPeriod = 0;
}
AddLabel(ThreeDayLabel and three_dayMinAggregationPeriod, "3D", if three_daysSqueeze then GlobalColor("Squeeze") else if three_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if three_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def two_daysPrice;
def two_daysATR;
def two_daysSDev;
def two_daysDenom;
def two_daysDenomLo;
def two_daysDenomHi;
def two_daysBBSInd;
def two_daysBBSIndLo;
def two_daysBBSIndHi;
def two_daysSqueeze;
def two_daysPreSqueeze;
def two_daysExtraSqueeze;
def two_dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWO_DAYS {
    two_daysPrice = close(period = "2 Days");
    two_daysATR = Average(TrueRange(high (period = "2 Days"), close(period = "2 Days"), low(period = "2 Days")), length);
    two_daysSDev = StDev(two_daysPrice, length);
    two_daysDenom = (nk * two_daysATR);
    two_daysDenomLo = (nkLo * two_daysATR);
    two_daysDenomHi = (nkHi * two_daysATR);
    two_daysBBSInd = If (two_daysDenom <> 0, ((nBB * two_daysSDev) / two_daysDenom), 0);
    two_daysBBSIndLo = If (two_daysDenomLo <> 0, ((nBB * two_daysSDev) / two_daysDenomLo), 0);
    two_daysBBSIndHi = If (two_daysDenomHi <> 0, ((nBB * two_daysSDev) / two_daysDenomHi), 0);
    two_daysSqueeze = if two_daysBBSInd < AlertLine then 1 else 0;
    two_daysPreSqueeze = if two_daysBBSIndHi < AlertLine then 1 else 0;
    two_daysExtraSqueeze = if two_daysBBSIndLo < AlertLine then 1 else 0;
    two_dayMinAggregationPeriod = 1;
}
else {
    two_daysPrice = 0;
    two_daysATR = 0;
    two_daysSDev = 0;
    two_daysDenom = 0;
    two_daysDenomLo = 0;
    two_daysDenomHi = 0;
    two_daysBBSInd = 0;
    two_daysBBSIndLo = 0;
    two_daysBBSIndHi = 0;
    two_daysSqueeze = 0;
    two_daysPreSqueeze = 0;
    two_daysExtraSqueeze = 0;
    two_dayMinAggregationPeriod = 0;
}
AddLabel(TwoDayLabel and two_dayMinAggregationPeriod, "2D", if two_daysSqueeze then GlobalColor("Squeeze") else if two_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if two_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def dayPrice;
def dayATR;
def daySDev;
def dayDenom;
def dayDenomLo;
def dayDenomHi;
def dayBBSInd;
def dayBBSIndLo;
def dayBBSIndHi;
def daySqueeze;
def dayPreSqueeze;
def dayExtraSqueeze;
def dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.DAY {
    dayPrice = close(period = "Day");
    dayATR = Average(TrueRange(high (period = "Day"), close(period = "Day"), low(period = "Day")), length);
    daySDev = StDev(dayPrice, length);
    dayDenom = (nk * dayATR);
    dayDenomLo = (nkLo * dayATR);
    dayDenomHi = (nkHi * dayATR);
    dayBBSInd = If (dayDenom <> 0, ((nBB * daySDev) / dayDenom), 0);
    dayBBSIndLo = If (dayDenomLo <> 0, ((nBB * daySDev) / dayDenomLo), 0);
    dayBBSIndHi = If (dayDenomHi <> 0, ((nBB * daySDev) / dayDenomHi), 0);
    daySqueeze = if dayBBSInd < AlertLine then 1 else 0;
    dayPreSqueeze = if dayBBSIndHi < AlertLine then 1 else 0;
    dayExtraSqueeze = if dayBBSIndLo < AlertLine then 1 else 0;
    dayMinAggregationPeriod = 1;
}
else {
    dayPrice = 0;
    dayATR = 0;
    daySDev = 0;
    dayDenom = 0;
    dayDenomLo = 0;
    dayDenomHi = 0;
    dayBBSInd = 0;
    dayBBSIndLo = 0;
    dayBBSIndHi = 0;
    daySqueeze = 0;
    dayPreSqueeze = 0;
    dayExtraSqueeze = 0;
    dayMinAggregationPeriod = 0;
}
AddLabel(DayLabel and dayMinAggregationPeriod, "D", if daySqueeze then GlobalColor("Squeeze") else if dayExtraSqueeze then GlobalColor("ExtraSqueeze") else if dayPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def four_hoursPrice;
def four_hoursATR;
def four_hoursSDev;
def four_hoursDenom;
def four_hoursDenomLo;
def four_hoursDenomHi;
def four_hoursBBSInd;
def four_hoursBBSIndLo;
def four_hoursBBSIndHi;
def four_hoursSqueeze;
def four_hoursPreSqueeze;
def four_hoursExtraSqueeze;
def FourHourMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_HOURS {
    four_hoursPrice = close(period = "4 Hours");
    four_hoursATR = Average(TrueRange(high (period = "4 Hours"), close(period = "4 Hours"), low(period = "4 Hours")), length);
    four_hoursSDev = StDev(four_hoursPrice, length);
    four_hoursDenom = (nk * four_hoursATR);
    four_hoursDenomLo = (nkLo * four_hoursATR);
    four_hoursDenomHi = (nkHi * four_hoursATR);
    four_hoursBBSInd = If (four_hoursDenom <> 0, ((nBB * four_hoursSDev) / four_hoursDenom), 0);
    four_hoursBBSIndLo = If (four_hoursDenomLo <> 0, ((nBB * four_hoursSDev) / four_hoursDenomLo), 0);
    four_hoursBBSIndHi = If (four_hoursDenomHi <> 0, ((nBB * four_hoursSDev) / four_hoursDenomHi), 0);
    four_hoursSqueeze = if four_hoursBBSInd < AlertLine then 1 else 0;
    four_hoursPreSqueeze = if four_hoursBBSIndHi < AlertLine then 1 else 0;
    four_hoursExtraSqueeze = if four_hoursBBSIndLo < AlertLine then 1 else 0;
    FourHourMinAggregationPeriod = 1;
}
else {
    four_hoursPrice = 0;
    four_hoursATR = 0;
    four_hoursSDev = 0;
    four_hoursDenom = 0;
    four_hoursDenomLo = 0;
    four_hoursDenomHi = 0;
    four_hoursBBSInd = 0;
    four_hoursBBSIndLo = 0;
    four_hoursBBSIndHi = 0;
    four_hoursSqueeze = 0;
    four_hoursPreSqueeze = 0;
    four_hoursExtraSqueeze = 0;
    FourHourMinAggregationPeriod = 0;
}
AddLabel(FourHourLabel and FourHourMinAggregationPeriod, "4h", if four_hoursSqueeze then GlobalColor("Squeeze") else if four_hoursPreSqueeze then GlobalColor("PreSqueeze") else if four_hoursExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("No Squeeze"));

def two_hoursPrice;
def two_hoursATR;
def two_hoursSDev;
def two_hoursDenom;
def two_hoursDenomLo;
def two_hoursDenomHi;
def two_hoursBBSInd;
def two_hoursBBSIndLo;
def two_hoursBBSIndHi;
def two_hoursSqueeze;
def two_hoursPreSqueeze;
def two_hoursExtraSqueeze;
def two_hoursMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.TWO_HOURS {
    two_hoursPrice = close(period = "2 Hours");
    two_hoursATR = Average(TrueRange(high (period = "2 Hours"), close(period = "2 Hours"), low(period = "2 Hours")), length);
    two_hoursSDev = StDev(two_hoursPrice, length);
    two_hoursDenom = (nk * two_hoursATR);
    two_hoursDenomLo = (nkLo * two_hoursATR);
    two_hoursDenomHi = (nkHi * two_hoursATR);
    two_hoursBBSInd = If (two_hoursDenom <> 0, ((nBB * two_hoursSDev) / two_hoursDenom), 0);
    two_hoursBBSIndLo = If (two_hoursDenomLo <> 0, ((nBB * two_hoursSDev) / two_hoursDenomLo), 0);
    two_hoursBBSIndHi = If (two_hoursDenomHi <> 0, ((nBB * two_hoursSDev) / two_hoursDenomHi), 0);
    two_hoursSqueeze = if two_hoursBBSInd < AlertLine then 1 else 0;
    two_hoursPreSqueeze = if two_hoursBBSIndHi < AlertLine then 1 else 0;
    two_hoursExtraSqueeze = if two_hoursBBSIndLo < AlertLine then 1 else 0;
    two_hoursMinAggregationPeriod = 1;
}
else {
    two_hoursPrice = 0;
    two_hoursATR = 0;
    two_hoursSDev = 0;
    two_hoursDenom = 0;
    two_hoursDenomLo = 0;
    two_hoursDenomHi = 0;
    two_hoursBBSInd = 0;
    two_hoursBBSIndLo = 0;
    two_hoursBBSIndHi = 0;
    two_hoursSqueeze = 0;
    two_hoursPreSqueeze = 0;
    two_hoursExtraSqueeze = 0;
    two_hoursMinAggregationPeriod = 0;
}
AddLabel(TwoHourLabel and two_hoursMinAggregationPeriod, "2h", if two_hoursPreSqueeze then GlobalColor("PreSqueeze") else if two_hoursSqueeze then GlobalColor("Squeeze" ) else if two_hoursExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("NO Squeeze"));

def hourPrice;
def hourATR;
def hourSDev;
def hourDenom;
def hourDenomLo;
def hourDenomHi;
def hourBBSInd;
def hourBBSIndLo;
def hourBBSIndHi;
def hourSqueeze;
def hourPreSqueeze;
def hourExtraSqueeze;
def HourMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.HOUR {
    hourPrice = close(period = "1 Hour");
    hourATR = Average(TrueRange(high (period = "1 Hour"), close(period = "1 Hour"), low(period = "1 Hour")), length);
    hourSDev = StDev(hourPrice, length);
    hourDenom = (nk * hourATR);
    hourDenomLo = (nkLo * hourATR);
    hourDenomHi = (nkHi * hourATR);
    hourBBSInd = If (hourDenom <> 0, ((nBB * hourSDev) / hourDenom), 0);
    hourBBSIndLo = If (hourDenomLo <> 0, ((nBB * hourSDev) / hourDenomLo), 0);
    hourBBSIndHi = If (hourDenomHi <> 0, ((nBB * hourSDev) / hourDenomHi), 0);
    hourSqueeze = if hourBBSInd < AlertLine then 1 else 0;
    hourPreSqueeze = if hourBBSIndHi < AlertLine then 1 else 0;
    hourExtraSqueeze = if hourBBSIndLo < AlertLine then 1 else 0;
    HourMinAggregationPeriod = 1;
}
else {
    hourPrice = 0;
    hourATR = 0;
    hourSDev = 0;
    hourDenom = 0;
    hourDenomLo = 0;
    hourDenomHi = 0;
    hourBBSInd = 0;
    hourBBSIndLo = 0;
    hourBBSIndHi = 0;
    hourSqueeze = 0;
    hourPreSqueeze = 0;
    hourExtraSqueeze = 0;
    HourMinAggregationPeriod = 0;
}
AddLabel(HourLabel and HourMinAggregationPeriod, "1h", if hourPreSqueeze then GlobalColor("PreSqueeze") else if hourSqueeze then GlobalColor("Squeeze" ) else if hourExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("NO Squeeze"));

def Thirty_MinPrice;
def Thirty_MinATR;
def Thirty_MinSDev;
def Thirty_MinDenom;
def Thirty_MinDenomLo;
def Thirty_MinDenomHi;
def Thirty_MinBBSInd;
def Thirty_MinBBSIndLo;
def Thirty_MinBBSIndHi;
def Thirty_MinSqueeze;
def Thirty_MinPreSqueeze;
def Thirty_MinExtraSqueeze;
def Thirty_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN {
    Thirty_MinPrice = close(period = "30 Min");
    Thirty_MinATR = Average(TrueRange(high (period = "30 Min"), close(period = "30 Min"), low(period = "30 Min")), length);
    Thirty_MinSDev = StDev(Thirty_MinPrice, length);
    Thirty_MinDenom = (nk * Thirty_MinATR);
    Thirty_MinDenomLo = (nkLo * Thirty_MinATR);
    Thirty_MinDenomHi = (nkHi * Thirty_MinATR);
    Thirty_MinBBSInd = If (Thirty_MinDenom <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenom), 0);
    Thirty_MinBBSIndLo = If (Thirty_MinDenomLo <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenomLo), 0);
    Thirty_MinBBSIndHi = If (Thirty_MinDenomHi <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenomHi), 0);
    Thirty_MinSqueeze = if Thirty_MinBBSInd < AlertLine then 1 else 0;
    Thirty_MinPreSqueeze = if Thirty_MinBBSIndHi < AlertLine then 1 else 0;
    Thirty_MinExtraSqueeze = if Thirty_MinBBSIndLo < AlertLine then 1 else 0;
    Thirty_MinAggregationPeriod = 1;
}
else {
    Thirty_MinPrice = 0;
    Thirty_MinATR = 0;
    Thirty_MinSDev = 0;
    Thirty_MinDenom = 0;
    Thirty_MinDenomLo = 0;
    Thirty_MinDenomHi = 0;
    Thirty_MinBBSInd = 0;
    Thirty_MinBBSIndLo = 0;
    Thirty_MinBBSIndHi = 0;
    Thirty_MinSqueeze = 0;
    Thirty_MinPreSqueeze = 0;
    Thirty_MinExtraSqueeze = 0;
    Thirty_MinAggregationPeriod = 0;
}
AddLabel(ThirtyMinLabel and Thirty_MinAggregationPeriod, "30m", if Thirty_MinSqueeze then GlobalColor("Squeeze") else if Thirty_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Thirty_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def Twenty_MinPrice;
def Twenty_MinATR;
def Twenty_MinSDev;
def Twenty_MinDenom;
def Twenty_MinDenomLo;
def Twenty_MinDenomHi;
def Twenty_MinBBSInd;
def Twenty_MinBBSIndLo;
def Twenty_MinBBSIndHi;
def Twenty_MinSqueeze;
def Twenty_MinPreSqueeze;
def Twenty_MinExtraSqueeze;
def Twenty_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWENTY_MIN {
    Twenty_MinPrice = close(period = "20 Min");
    Twenty_MinATR = Average(TrueRange(high (period = "20 Min"), close(period = "20 Min"), low(period = "20 Min")), length);
    Twenty_MinSDev = StDev(Twenty_MinPrice, length);
    Twenty_MinDenom = (nk * Twenty_MinATR);
    Twenty_MinDenomLo = (nkLo * Twenty_MinATR);
    Twenty_MinDenomHi = (nkHi * Twenty_MinATR);
    Twenty_MinBBSInd = If (Twenty_MinDenom <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenom), 0);
    Twenty_MinBBSIndLo = If (Twenty_MinDenomLo <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenomLo), 0);
    Twenty_MinBBSIndHi = If (Twenty_MinDenomHi <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenomHi), 0);
    Twenty_MinSqueeze = if Twenty_MinBBSInd < AlertLine then 1 else 0;
    Twenty_MinPreSqueeze = if Twenty_MinBBSIndHi < AlertLine then 1 else 0;
    Twenty_MinExtraSqueeze = if Twenty_MinBBSIndLo < AlertLine then 1 else 0;
    Twenty_MinAggregationPeriod = 1;
}
else {
    Twenty_MinPrice = 0;
    Twenty_MinATR = 0;
    Twenty_MinSDev = 0;
    Twenty_MinDenom = 0;
    Twenty_MinDenomLo = 0;
    Twenty_MinDenomHi = 0;
    Twenty_MinBBSInd = 0;
    Twenty_MinBBSIndLo = 0;
    Twenty_MinBBSIndHi = 0;
    Twenty_MinSqueeze = 0;
    Twenty_MinPreSqueeze = 0;
    Twenty_MinExtraSqueeze = 0;
    Twenty_MinAggregationPeriod = 0;
}
AddLabel(TwentyMinLabel and Twenty_MinAggregationPeriod, "20m", if Twenty_MinSqueeze then GlobalColor("Squeeze") else if Twenty_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Twenty_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def Fifteen_MinPrice;
def Fifteen_MinATR;
def Fifteen_MinSDev;
def Fifteen_MinDenom;
def Fifteen_MinDenomLo;
def Fifteen_MinDenomHi;
def Fifteen_MinBBSInd;
def Fifteen_MinBBSIndLo;
def Fifteen_MinBBSIndHi;
def Fifteen_MinSqueeze;
def Fifteen_MinPreSqueeze;
def Fifteen_MinExtraSqueeze;
def Fifteen_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN {
    Fifteen_MinPrice = close(period = "15 Min");
    Fifteen_MinATR = Average(TrueRange(high (period = "15 Min"), close(period = "15 Min"), low(period = "15 Min")), length);
    Fifteen_MinSDev = StDev(Fifteen_MinPrice, length);
    Fifteen_MinDenom = (nk * Fifteen_MinATR);
    Fifteen_MinDenomLo = (nkLo * Fifteen_MinATR);
    Fifteen_MinDenomHi = (nkHi * Fifteen_MinATR);
    Fifteen_MinBBSInd = If (Fifteen_MinDenom <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenom), 0);
    Fifteen_MinBBSIndLo = If (Fifteen_MinDenomLo <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenomLo), 0);
    Fifteen_MinBBSIndHi = If (Fifteen_MinDenomHi <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenomHi), 0);
    Fifteen_MinSqueeze = if Fifteen_MinBBSInd < AlertLine then 1 else 0;
    Fifteen_MinPreSqueeze = if Fifteen_MinBBSIndHi < AlertLine then 1 else 0;
    Fifteen_MinExtraSqueeze = if Fifteen_MinBBSIndLo < AlertLine then 1 else 0;
    Fifteen_MinAggregationPeriod = 1;
}
else {
    Fifteen_MinPrice = 0;
    Fifteen_MinATR = 0;
    Fifteen_MinSDev = 0;
    Fifteen_MinDenom = 0;
    Fifteen_MinDenomLo = 0;
    Fifteen_MinDenomHi = 0;
    Fifteen_MinBBSInd = 0;
    Fifteen_MinBBSIndLo = 0;
    Fifteen_MinBBSIndHi = 0;
    Fifteen_MinSqueeze = 0;
    Fifteen_MinPreSqueeze = 0;
    Fifteen_MinExtraSqueeze = 0;
    Fifteen_MinAggregationPeriod = 0;
}
AddLabel(FifteenMinLabel and Fifteen_MinAggregationPeriod, "15m", if Fifteen_MinSqueeze then GlobalColor("Squeeze") else if Fifteen_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Fifteen_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def ten_minPrice;
def ten_minATR;
def ten_minSDev;
def ten_minDenom;
def ten_minDenomLo;
def ten_minDenomHi;
def ten_minBBSInd;
def ten_minBBSIndLo;
def ten_minBBSIndHi;
def ten_minSqueeze;
def ten_minPreSqueeze;
def ten_minExtraSqueeze;
def ten_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TEN_MIN {
    ten_minPrice = close(period = "10 Min");
    ten_minATR = Average(TrueRange(high (period = "10 Min"), close(period = "10 Min"), low(period = "10 Min")), length);
    ten_minSDev = StDev(ten_minPrice, length);
    ten_minDenom = (nk * ten_minATR);
    ten_minDenomLo = (nkLo * ten_minATR);
    ten_minDenomHi = (nkHi * ten_minATR);
    ten_minBBSInd = If (ten_minDenom <> 0, ((nBB * ten_minSDev) / ten_minDenom), 0);
    ten_minBBSIndLo = If (ten_minDenomLo <> 0, ((nBB * ten_minSDev) / ten_minDenomLo), 0);
    ten_minBBSIndHi = If (ten_minDenomHi <> 0, ((nBB * ten_minSDev) / ten_minDenomHi), 0);
    ten_minSqueeze = if ten_minBBSInd < AlertLine then 1 else 0;
    ten_minPreSqueeze = if ten_minBBSIndHi < AlertLine then 1 else 0;
    ten_minExtraSqueeze = if ten_minBBSIndLo < AlertLine then 1 else 0;
    ten_minAggregationPeriod = 1;
}
else {
    ten_minPrice = 0;
    ten_minATR = 0;
    ten_minSDev = 0;
    ten_minDenom = 0;
    ten_minDenomLo = 0;
    ten_minDenomHi = 0;
    ten_minBBSInd = 0;
    ten_minBBSIndLo = 0;
    ten_minBBSIndHi = 0;
    ten_minSqueeze = 0;
    ten_minPreSqueeze = 0;
    ten_minExtraSqueeze = 0;
    ten_minAggregationPeriod = 0;
}
AddLabel(TenMinLabel and ten_minAggregationPeriod, "10m", if ten_minSqueeze then GlobalColor("Squeeze") else if ten_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if ten_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def five_minPrice;
def five_minATR;
def five_minSDev;
def five_minDenom;
def five_minDenomLo;
def five_minDenomHi;
def five_minBBSInd;
def five_minBBSIndLo;
def five_minBBSIndHi;
def five_minSqueeze;
def five_minPreSqueeze;
def five_minExtraSqueeze;
def five_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN {
    five_minPrice = close(period = "5 Min");
    five_minATR = Average(TrueRange(high (period = "5 Min"), close(period = "5 Min"), low(period = "5 Min")), length);
    five_minSDev = StDev(five_minPrice, length);
    five_minDenom = (nk * five_minATR);
    five_minDenomLo = (nkLo * five_minATR);
    five_minDenomHi = (nkHi * five_minATR);
    five_minBBSInd = If (five_minDenom <> 0, ((nBB * five_minSDev) / five_minDenom), 0);
    five_minBBSIndLo = If (five_minDenomLo <> 0, ((nBB * five_minSDev) / five_minDenomLo), 0);
    five_minBBSIndHi = If (five_minDenomHi <> 0, ((nBB * five_minSDev) / five_minDenomHi), 0);
    five_minSqueeze = if five_minBBSInd < AlertLine then 1 else 0;
    five_minPreSqueeze = if five_minBBSIndHi < AlertLine then 1 else 0;
    five_minExtraSqueeze = if five_minBBSIndLo < AlertLine then 1 else 0;
    five_minAggregationPeriod = 1;
}
else {
    five_minPrice = 0;
    five_minATR = 0;
    five_minSDev = 0;
    five_minDenom = 0;
    five_minDenomLo = 0;
    five_minDenomHi = 0;
    five_minBBSInd = 0;
    five_minBBSIndLo = 0;
    five_minBBSIndHi = 0;
    five_minSqueeze = 0;
    five_minPreSqueeze = 0;
    five_minExtraSqueeze = 0;
    five_minAggregationPeriod = 0;
}
AddLabel(FiveMinLabel and five_minAggregationPeriod, "5m", if five_minSqueeze then GlobalColor("Squeeze") else if five_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if five_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def four_minPrice;
def four_minATR;
def four_minSDev;
def four_minDenom;
def four_minDenomLo;
def four_minDenomHi;
def four_minBBSInd;
def four_minBBSIndLo;
def four_minBBSIndHi;
def four_minSqueeze;
def four_minPreSqueeze;
def four_minExtraSqueeze;
def four_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FOUR_MIN {
    four_minPrice = close(period = "4 Min");
    four_minATR = Average(TrueRange(high (period = "4 Min"), close(period = "4 Min"), low(period = "4 Min")), length);
    four_minSDev = StDev(four_minPrice, length);
    four_minDenom = (nk * four_minATR);
    four_minDenomLo = (nkLo * four_minATR);
    four_minDenomHi = (nkHi * four_minATR);
    four_minBBSInd = If (four_minDenom <> 0, ((nBB * four_minSDev) / four_minDenom), 0);
    four_minBBSIndLo = If (four_minDenomLo <> 0, ((nBB * four_minSDev) / four_minDenomLo), 0);
    four_minBBSIndHi = If (four_minDenomHi <> 0, ((nBB * four_minSDev) / four_minDenomHi), 0);
    four_minSqueeze = if four_minBBSInd < AlertLine then 1 else 0;
    four_minPreSqueeze = if four_minBBSIndHi < AlertLine then 1 else 0;
    four_minExtraSqueeze = if four_minBBSIndLo < AlertLine then 1 else 0;
    four_minAggregationPeriod = 1;
}
else {
    four_minPrice = 0;
    four_minATR = 0;
    four_minSDev = 0;
    four_minDenom = 0;
    four_minDenomLo = 0;
    four_minDenomHi = 0;
    four_minBBSInd = 0;
    four_minBBSIndLo = 0;
    four_minBBSIndHi = 0;
    four_minSqueeze = 0;
    four_minPreSqueeze = 0;
    four_minExtraSqueeze = 0;
    four_minAggregationPeriod = 0;
}
AddLabel(FourMinLabel and four_minAggregationPeriod, "4m", if four_minSqueeze then GlobalColor("Squeeze") else if four_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if four_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def three_minPrice;
def three_minATR;
def three_minSDev;
def three_minDenom;
def three_minDenomLo;
def three_minDenomHi;
def three_minBBSInd;
def three_minBBSIndLo;
def three_minBBSIndHi;
def three_minSqueeze;
def three_minPreSqueeze;
def three_minExtraSqueeze;
def three_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THREE_MIN {
    three_minPrice = close(period = "3 Min");
    three_minATR = Average(TrueRange(high (period = "3 Min"), close(period = "3 Min"), low(period = "3 Min")), length);
    three_minSDev = StDev(three_minPrice, length);
    three_minDenom = (nk * three_minATR);
    three_minDenomLo = (nkLo * three_minATR);
    three_minDenomHi = (nkHi * three_minATR);
    three_minBBSInd = If (three_minDenom <> 0, ((nBB * three_minSDev) / three_minDenom), 0);
    three_minBBSIndLo = If (three_minDenomLo <> 0, ((nBB * three_minSDev) / three_minDenomLo), 0);
    three_minBBSIndHi = If (three_minDenomHi <> 0, ((nBB * three_minSDev) / three_minDenomHi), 0);
    three_minSqueeze = if three_minBBSInd < AlertLine then 1 else 0;
    three_minPreSqueeze = if three_minBBSIndHi < AlertLine then 1 else 0;
    three_minExtraSqueeze = if three_minBBSIndLo < AlertLine then 1 else 0;
    three_minAggregationPeriod = 1;
}
else {
    three_minPrice = 0;
    three_minATR = 0;
    three_minSDev = 0;
    three_minDenom = 0;
    three_minDenomLo = 0;
    three_minDenomHi = 0;
    three_minBBSInd = 0;
    three_minBBSIndLo = 0;
    three_minBBSIndHi = 0;
    three_minSqueeze = 0;
    three_minPreSqueeze = 0;
    three_minExtraSqueeze = 0;
    three_minAggregationPeriod = 0;
}
AddLabel(ThreeMinLabel and three_minAggregationPeriod, "3m", if three_minSqueeze then GlobalColor("Squeeze") else if three_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if three_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def two_minPrice;
def two_minATR;
def two_minSDev;
def two_minDenom;
def two_minDenomLo;
def two_minDenomHi;
def two_minBBSInd;
def two_minBBSIndLo;
def two_minBBSIndHi;
def two_minSqueeze;
def two_minPreSqueeze;
def two_minExtraSqueeze;
def two_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWO_MIN {
    two_minPrice = close(period = "2 Min");
    two_minATR = Average(TrueRange(high (period = "2 Min"), close(period = "2 Min"), low(period = "2 Min")), length);
    two_minSDev = StDev(two_minPrice, length);
    two_minDenom = (nk * two_minATR);
    two_minDenomLo = (nkLo * two_minATR);
    two_minDenomHi = (nkHi * two_minATR);
    two_minBBSInd = If (two_minDenom <> 0, ((nBB * two_minSDev) / two_minDenom), 0);
    two_minBBSIndLo = If (two_minDenomLo <> 0, ((nBB * two_minSDev) / two_minDenomLo), 0);
    two_minBBSIndHi = If (two_minDenomHi <> 0, ((nBB * two_minSDev) / two_minDenomHi), 0);
    two_minSqueeze = if two_minBBSInd < AlertLine then 1 else 0;
    two_minPreSqueeze = if two_minBBSIndHi < AlertLine then 1 else 0;
    two_minExtraSqueeze = if two_minBBSIndLo < AlertLine then 1 else 0;
    two_minAggregationPeriod = 1;
}
else {
    two_minPrice = 0;
    two_minATR = 0;
    two_minSDev = 0;
    two_minDenom = 0;
    two_minDenomLo = 0;
    two_minDenomHi = 0;
    two_minBBSInd = 0;
    two_minBBSIndLo = 0;
    two_minBBSIndHi = 0;
    two_minSqueeze = 0;
    two_minPreSqueeze = 0;
    two_minExtraSqueeze = 0;
    two_minAggregationPeriod = 0;
}
AddLabel(TwoMinLabel and two_minAggregationPeriod, "2m", if two_minSqueeze then GlobalColor("Squeeze") else if two_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if two_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def one_minPrice;
def one_minATR;
def one_minSDev;
def one_minDenom;
def one_minDenomLo;
def one_minDenomHi;
def one_minBBSInd;
def one_minBBSIndLo;
def one_minBBSIndHi;
def one_minSqueeze;
def one_minPreSqueeze;
def one_minExtraSqueeze;
def one_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.MIN {
    one_minPrice = close(period = "1 Min");
    one_minATR = Average(TrueRange(high (period = "1 Min"), close(period = "1 Min"), low(period = "1 Min")), length);
    one_minSDev = StDev(one_minPrice, length);
    one_minDenom = (nk * one_minATR);
    one_minDenomLo = (nkLo * one_minATR);
    one_minDenomHi = (nkHi * one_minATR);
    one_minBBSInd = If (one_minDenom <> 0, ((nBB * one_minSDev) / one_minDenom), 0);
    one_minBBSIndLo = If (one_minDenomLo <> 0, ((nBB * one_minSDev) / one_minDenomLo), 0);
    one_minBBSIndHi = If (one_minDenomHi <> 0, ((nBB * one_minSDev) / one_minDenomHi), 0);
    one_minSqueeze = if one_minBBSInd < AlertLine then 1 else 0;
    one_minPreSqueeze = if one_minBBSIndHi < AlertLine then 1 else 0;
    one_minExtraSqueeze = if one_minBBSIndLo < AlertLine then 1 else 0;
    one_minAggregationPeriod = 1;
}
else {
    one_minPrice = 0;
    one_minATR = 0;
    one_minSDev = 0;
    one_minDenom = 0;
    one_minDenomLo = 0;
    one_minDenomHi = 0;
    one_minBBSInd = 0;
    one_minBBSIndLo = 0;
    one_minBBSIndHi = 0;
    one_minSqueeze = 0;
    one_minPreSqueeze = 0;
    one_minExtraSqueeze = 0;
    one_minAggregationPeriod = 0;
}
AddLabel(OneMinLabel and one_minAggregationPeriod, "1m", if one_minSqueeze then GlobalColor("Squeeze") else if one_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if one_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
Hi CaseyJBrett - thank you so much for this MTF indicator, it has been a great help thus far. I just have one question - can you please explain what's happening when the Orange - PreSqueeze and Yellow extra squeeze colors are shown. Thank you again for this!
 
you’re welcome! Sure!

To clarify in case you don’t already know, BOLLINGER Bands plot +/- 1 standard deviation of the symbol you’re charting.

The presqueeze utilizes “looser” constraints. This is literal as well. For a presqueeze the nk (keltner channel) factor is set to 2. Meaning, in order for the alert to be triggered, the BOLLINGER bands (BB) need to constrict inside of the nk’s that are placed at +\- 2 ATR. The original squeeze uses an nk factor of 1.5 (nk’s are set to +\- 1.5 ATR and alert triggers when BB constrict to the point that they’re inside the nk’s). Finally, the extra squeeze uses an nk factor of 1. So they’re placed at +/- 1 ATR and the extra squeeze is triggered when the BB constrict so much that they’re inside of those nk’s.

I’m simpler terms, I typically expect a much stronger move to either the upside or downside once the extra squeeze fires versus the original squeeze. Same goes for original squeeze versus presqueeze. Hope this helps!
 
@caseyjbrett thank you for your work
is thee a way to turn this into watch list colums ?
You’re welcome! Like MerryDay said, you cannot use MTF indicators in watch list columns. Ultimately, you can achieve what you’re looking for, you’d just have to isolate the part of the script that defines what presqueeze, squeeze, and extra squeezes are and create a new indicator with it and define the aggregation period (time frame) you want it to check for squeezes in. Then copy that script into another, newly created, indicator and change the aggregation period to another timeframe you want to see squeezes in. Then repeat that for however many time frames you want to see the squeezes for within your watchlist. At one point, I did this. However, I got rid of it soon after because it took so much memory for TOS to visualize that I had to remove all other custom watchlist columns. I’ve since deleted it though. But it is possible! There’s just some work to do to get there.
 
Here is the script I wrote for MTF (Multi Time Frame) Squeeze Pro Labels. Just to be clear, this is NOT the same as my MTF Squeeze HISTOGRAM Labels. These labels change colors based on the presence/absence of a squeeze. If there's an original squeeze, the label's red, if there's a "Pre-Squeeze" the label's orange, if there's an "Extra-Squeeze" the label's yellow, and if there's no squeeze, the label's green. Per a recent comment under my MTF Squeeze HISTOGRAM Labels thread, I have revised this script (1/5/2022). This script is more succinct with the Global Colors. More importantly, you are now able to turn on/off any time frames that you do not wish to be displayed on your chart(s). Enjoy!
Code:
#MTF SQUEEZE PRO LABELS
#BY: CASEY BRETT WITH THE USE OF CODE FROM: TOS Indicators

##Global Variables
input length = 20;
def AlertLine = 1;
input nk = 1.5;
input nkHi = 2;
input nkLo = 1;
def nBB = 2;
input averageType = AverageType.EXPONENTIAL;
def displace = 0;
input trueRangeAverageType = AverageType.SIMPLE;


input MonthLabel = yes;
input WeekLabel = yes;
input FourDayLabel = yes;
input ThreeDayLabel = yes;
input TwoDayLabel = yes;
input DayLabel = yes;
input FourHourLabel = yes;
input TwoHourLabel = yes;
input HourLabel = yes;
input ThirtyMinLabel = yes;
input TwentyMinLabel = yes;
input FifteenMinLabel = yes;
input TenMinLabel = yes;
input FiveMinLabel = yes;
input FourMinLabel = yes;
input ThreeMinLabel = yes;
input TwoMinLabel = yes;
input OneMinLabel = yes;


DefineGlobalColor("Squeeze", Color.RED);
DefineGlobalColor("PreSqueeze", Color.ORANGE);
DefineGlobalColor("ExtraSqueeze", Color.YELLOW);
DefineGlobalColor("NO Squeeze", Color.DARK_GREEN);

## Month Aggregation Period Variables

def monthPrice;
def monthATR;
def monthSDev;
def monthDenom;
def monthDenomLo;
def monthDenomHi;
def monthBBSInd;
def monthBBSIndLo;
def monthBBSIndHi;
def monthSqueeze;
def monthPreSqueeze;
def monthExtraSqueeze;
def monthAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.MONTH {
    monthPrice = close(period = "Month");
    monthATR = Average(TrueRange(high (period = "Month"), close(period = "Month"), low(period = "Month")), length);
    monthSDev = StDev(monthPrice, length);
    monthDenom = (nk * monthATR);
    monthDenomLo = (nkLo * monthATR);
    monthDenomHi = (nkHi * monthATR);
    monthBBSInd = If (monthDenom <> 0, ((nBB * monthSDev) / monthDenom), 0);
    monthBBSIndLo = If (monthDenomLo <> 0, ((nBB * monthSDev) / monthDenomLo), 0);
    monthBBSIndHi = If (monthDenomHi <> 0, ((nBB * monthSDev) / monthDenomHi), 0);
    monthSqueeze = if monthBBSInd < AlertLine then 1 else 0;
    monthPreSqueeze = if monthBBSIndHi < AlertLine then 1 else 0;
    monthExtraSqueeze = if monthBBSIndLo < AlertLine then 1 else 0;
    monthAggregationPeriod = 1;
}
else {
    monthPrice = 0;
    monthATR = 0;
    monthSDev = 0;
    monthDenom = 0;
    monthDenomLo = 0;
    monthDenomHi = 0;
    monthBBSInd = 0;
    monthBBSIndLo = 0;
    monthBBSIndHi = 0;
    monthSqueeze = 0;
    monthPreSqueeze = 0;
    monthExtraSqueeze = 0;
    monthAggregationPeriod = 0;
}
AddLabel(MonthLabel and monthAggregationPeriod, "M", if monthSqueeze then GlobalColor("Squeeze") else if monthExtraSqueeze then GlobalColor("ExtraSqueeze") else if monthPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def weekPrice;
def weekATR;
def weekSDev;
def weekDenom;
def weekDenomLo;
def weekDenomHi;
def weekBBSInd;
def weekBBSIndLo;
def weekBBSIndHi;
def weekSqueeze;
def weekPreSqueeze;
def weekExtraSqueeze;
def WeekAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.WEEK {
    weekPrice = close(period = "week");
    weekATR = Average(TrueRange(high (period = "week"), close(period = "week"), low(period = "week")), length);
    weekSDev = StDev(weekPrice, length);
    weekDenom = (nk * weekATR);
    weekDenomLo = (nkLo * weekATR);
    weekDenomHi = (nkHi * weekATR);
    weekBBSInd = If (weekDenom <> 0, ((nBB * weekSDev) / weekDenom), 0);
    weekBBSIndLo = If (weekDenomLo <> 0, ((nBB * weekSDev) / weekDenomLo), 0);
    weekBBSIndHi = If (weekDenomHi <> 0, ((nBB * weekSDev) / weekDenomHi), 0);
    weekSqueeze = if weekBBSInd < AlertLine then 1 else 0;
    weekPreSqueeze = if weekBBSIndHi < AlertLine then 1 else 0;
    weekExtraSqueeze = if weekBBSIndLo < AlertLine then 1 else 0;
    WeekAggregationPeriod = 1;
}
else {
    weekPrice = 0;
    weekATR = 0;
    weekSDev = 0;
    weekDenom = 0;
    weekDenomLo = 0;
    weekDenomHi = 0;
    weekBBSInd = 0;
    weekBBSIndLo = 0;
    weekBBSIndHi = 0;
    weekSqueeze = 0;
    weekPreSqueeze = 0;
    weekExtraSqueeze = 0;
    WeekAggregationPeriod = 0;
}
AddLabel(WeekLabel and WeekAggregationPeriod, "W", if weekSqueeze then GlobalColor("Squeeze") else if weekExtraSqueeze then GlobalColor("ExtraSqueeze") else if weekPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
# AddLabel(weekExtraSqueeze and weekAggregationPeriod, "W", globalColor("week Squeeze"));
# AddLabel(!weekSqueeze and weekAggregationPeriod,"W", globalColor("NO week Squeeze"));


def four_daysPrice;
def four_daysATR;
def four_daysSDev;
def four_daysDenom;
def four_daysDenomLo;
def four_daysDenomHi;
def four_daysBBSInd;
def four_daysBBSIndLo;
def four_daysBBSIndHi;
def four_daysSqueeze;
def four_daysPreSqueeze;
def four_daysExtraSqueeze;
def Four_DayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FOUR_DAYS {
    four_daysPrice = close(period = "4 Days");
    four_daysATR = Average(TrueRange(high (period = "4 Days"), close(period = "4 Days"), low(period = "4 Days")), length);
    four_daysSDev = StDev(four_daysPrice, length);
    four_daysDenom = (nk * four_daysATR);
    four_daysDenomLo = (nkLo * four_daysATR);
    four_daysDenomHi = (nkHi * four_daysATR);
    four_daysBBSInd = If (four_daysDenom <> 0, ((nBB * four_daysSDev) / four_daysDenom), 0);
    four_daysBBSIndLo = If (four_daysDenomLo <> 0, ((nBB * four_daysSDev) / four_daysDenomLo), 0);
    four_daysBBSIndHi = If (four_daysDenomHi <> 0, ((nBB * four_daysSDev) / four_daysDenomHi), 0);
    four_daysSqueeze = if four_daysBBSInd < AlertLine then 1 else 0;
    four_daysPreSqueeze = if four_daysBBSIndHi < AlertLine then 1 else 0;
    four_daysExtraSqueeze = if four_daysBBSIndLo < AlertLine then 1 else 0;
    Four_DayMinAggregationPeriod = 1;
}
else {
    four_daysPrice = 0;
    four_daysATR = 0;
    four_daysSDev = 0;
    four_daysDenom = 0;
    four_daysDenomLo = 0;
    four_daysDenomHi = 0;
    four_daysBBSInd = 0;
    four_daysBBSIndLo = 0;
    four_daysBBSIndHi = 0;
    four_daysSqueeze = 0;
    four_daysPreSqueeze = 0;
    four_daysExtraSqueeze = 0;
    Four_DayMinAggregationPeriod = 0;
}
AddLabel(FourDayLabel and Four_DayMinAggregationPeriod, "4D", if four_daysSqueeze then GlobalColor("Squeeze") else if four_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if four_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
# AddLabel(four_daysExtraSqueeze and four_daysAggregationPeriod, "W", globalColor("four_days Squeeze"));
# AddLabel(!four_daysSqueeze and four_daysAggregationPeriod,"W", globalColor("NO four_days Squeeze"));


def three_daysPrice;
def three_daysATR;
def three_daysSDev;
def three_daysDenom;
def three_daysDenomLo;
def three_daysDenomHi;
def three_daysBBSInd;
def three_daysBBSIndLo;
def three_daysBBSIndHi;
def three_daysSqueeze;
def three_daysPreSqueeze;
def three_daysExtraSqueeze;
def three_dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THREE_DAYS {
    three_daysPrice = close(period = "3 Days");
    three_daysATR = Average(TrueRange(high (period = "3 Days"), close(period = "3 Days"), low(period = "3 Days")), length);
    three_daysSDev = StDev(three_daysPrice, length);
    three_daysDenom = (nk * three_daysATR);
    three_daysDenomLo = (nkLo * three_daysATR);
    three_daysDenomHi = (nkHi * three_daysATR);
    three_daysBBSInd = If (three_daysDenom <> 0, ((nBB * three_daysSDev) / three_daysDenom), 0);
    three_daysBBSIndLo = If (three_daysDenomLo <> 0, ((nBB * three_daysSDev) / three_daysDenomLo), 0);
    three_daysBBSIndHi = If (three_daysDenomHi <> 0, ((nBB * three_daysSDev) / three_daysDenomHi), 0);
    three_daysSqueeze = if three_daysBBSInd < AlertLine then 1 else 0;
    three_daysPreSqueeze = if three_daysBBSIndHi < AlertLine then 1 else 0;
    three_daysExtraSqueeze = if three_daysBBSIndLo < AlertLine then 1 else 0;
    three_dayMinAggregationPeriod = 1;
}
else {
    three_daysPrice = 0;
    three_daysATR = 0;
    three_daysSDev = 0;
    three_daysDenom = 0;
    three_daysDenomLo = 0;
    three_daysDenomHi = 0;
    three_daysBBSInd = 0;
    three_daysBBSIndLo = 0;
    three_daysBBSIndHi = 0;
    three_daysSqueeze = 0;
    three_daysPreSqueeze = 0;
    three_daysExtraSqueeze = 0;
    three_dayMinAggregationPeriod = 0;
}
AddLabel(ThreeDayLabel and three_dayMinAggregationPeriod, "3D", if three_daysSqueeze then GlobalColor("Squeeze") else if three_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if three_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def two_daysPrice;
def two_daysATR;
def two_daysSDev;
def two_daysDenom;
def two_daysDenomLo;
def two_daysDenomHi;
def two_daysBBSInd;
def two_daysBBSIndLo;
def two_daysBBSIndHi;
def two_daysSqueeze;
def two_daysPreSqueeze;
def two_daysExtraSqueeze;
def two_dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWO_DAYS {
    two_daysPrice = close(period = "2 Days");
    two_daysATR = Average(TrueRange(high (period = "2 Days"), close(period = "2 Days"), low(period = "2 Days")), length);
    two_daysSDev = StDev(two_daysPrice, length);
    two_daysDenom = (nk * two_daysATR);
    two_daysDenomLo = (nkLo * two_daysATR);
    two_daysDenomHi = (nkHi * two_daysATR);
    two_daysBBSInd = If (two_daysDenom <> 0, ((nBB * two_daysSDev) / two_daysDenom), 0);
    two_daysBBSIndLo = If (two_daysDenomLo <> 0, ((nBB * two_daysSDev) / two_daysDenomLo), 0);
    two_daysBBSIndHi = If (two_daysDenomHi <> 0, ((nBB * two_daysSDev) / two_daysDenomHi), 0);
    two_daysSqueeze = if two_daysBBSInd < AlertLine then 1 else 0;
    two_daysPreSqueeze = if two_daysBBSIndHi < AlertLine then 1 else 0;
    two_daysExtraSqueeze = if two_daysBBSIndLo < AlertLine then 1 else 0;
    two_dayMinAggregationPeriod = 1;
}
else {
    two_daysPrice = 0;
    two_daysATR = 0;
    two_daysSDev = 0;
    two_daysDenom = 0;
    two_daysDenomLo = 0;
    two_daysDenomHi = 0;
    two_daysBBSInd = 0;
    two_daysBBSIndLo = 0;
    two_daysBBSIndHi = 0;
    two_daysSqueeze = 0;
    two_daysPreSqueeze = 0;
    two_daysExtraSqueeze = 0;
    two_dayMinAggregationPeriod = 0;
}
AddLabel(TwoDayLabel and two_dayMinAggregationPeriod, "2D", if two_daysSqueeze then GlobalColor("Squeeze") else if two_daysExtraSqueeze then GlobalColor("ExtraSqueeze") else if two_daysPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def dayPrice;
def dayATR;
def daySDev;
def dayDenom;
def dayDenomLo;
def dayDenomHi;
def dayBBSInd;
def dayBBSIndLo;
def dayBBSIndHi;
def daySqueeze;
def dayPreSqueeze;
def dayExtraSqueeze;
def dayMinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.DAY {
    dayPrice = close(period = "Day");
    dayATR = Average(TrueRange(high (period = "Day"), close(period = "Day"), low(period = "Day")), length);
    daySDev = StDev(dayPrice, length);
    dayDenom = (nk * dayATR);
    dayDenomLo = (nkLo * dayATR);
    dayDenomHi = (nkHi * dayATR);
    dayBBSInd = If (dayDenom <> 0, ((nBB * daySDev) / dayDenom), 0);
    dayBBSIndLo = If (dayDenomLo <> 0, ((nBB * daySDev) / dayDenomLo), 0);
    dayBBSIndHi = If (dayDenomHi <> 0, ((nBB * daySDev) / dayDenomHi), 0);
    daySqueeze = if dayBBSInd < AlertLine then 1 else 0;
    dayPreSqueeze = if dayBBSIndHi < AlertLine then 1 else 0;
    dayExtraSqueeze = if dayBBSIndLo < AlertLine then 1 else 0;
    dayMinAggregationPeriod = 1;
}
else {
    dayPrice = 0;
    dayATR = 0;
    daySDev = 0;
    dayDenom = 0;
    dayDenomLo = 0;
    dayDenomHi = 0;
    dayBBSInd = 0;
    dayBBSIndLo = 0;
    dayBBSIndHi = 0;
    daySqueeze = 0;
    dayPreSqueeze = 0;
    dayExtraSqueeze = 0;
    dayMinAggregationPeriod = 0;
}
AddLabel(DayLabel and dayMinAggregationPeriod, "D", if daySqueeze then GlobalColor("Squeeze") else if dayExtraSqueeze then GlobalColor("ExtraSqueeze") else if dayPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def four_hoursPrice;
def four_hoursATR;
def four_hoursSDev;
def four_hoursDenom;
def four_hoursDenomLo;
def four_hoursDenomHi;
def four_hoursBBSInd;
def four_hoursBBSIndLo;
def four_hoursBBSIndHi;
def four_hoursSqueeze;
def four_hoursPreSqueeze;
def four_hoursExtraSqueeze;
def FourHourMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_HOURS {
    four_hoursPrice = close(period = "4 Hours");
    four_hoursATR = Average(TrueRange(high (period = "4 Hours"), close(period = "4 Hours"), low(period = "4 Hours")), length);
    four_hoursSDev = StDev(four_hoursPrice, length);
    four_hoursDenom = (nk * four_hoursATR);
    four_hoursDenomLo = (nkLo * four_hoursATR);
    four_hoursDenomHi = (nkHi * four_hoursATR);
    four_hoursBBSInd = If (four_hoursDenom <> 0, ((nBB * four_hoursSDev) / four_hoursDenom), 0);
    four_hoursBBSIndLo = If (four_hoursDenomLo <> 0, ((nBB * four_hoursSDev) / four_hoursDenomLo), 0);
    four_hoursBBSIndHi = If (four_hoursDenomHi <> 0, ((nBB * four_hoursSDev) / four_hoursDenomHi), 0);
    four_hoursSqueeze = if four_hoursBBSInd < AlertLine then 1 else 0;
    four_hoursPreSqueeze = if four_hoursBBSIndHi < AlertLine then 1 else 0;
    four_hoursExtraSqueeze = if four_hoursBBSIndLo < AlertLine then 1 else 0;
    FourHourMinAggregationPeriod = 1;
}
else {
    four_hoursPrice = 0;
    four_hoursATR = 0;
    four_hoursSDev = 0;
    four_hoursDenom = 0;
    four_hoursDenomLo = 0;
    four_hoursDenomHi = 0;
    four_hoursBBSInd = 0;
    four_hoursBBSIndLo = 0;
    four_hoursBBSIndHi = 0;
    four_hoursSqueeze = 0;
    four_hoursPreSqueeze = 0;
    four_hoursExtraSqueeze = 0;
    FourHourMinAggregationPeriod = 0;
}
AddLabel(FourHourLabel and FourHourMinAggregationPeriod, "4h", if four_hoursSqueeze then GlobalColor("Squeeze") else if four_hoursPreSqueeze then GlobalColor("PreSqueeze") else if four_hoursExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("No Squeeze"));

def two_hoursPrice;
def two_hoursATR;
def two_hoursSDev;
def two_hoursDenom;
def two_hoursDenomLo;
def two_hoursDenomHi;
def two_hoursBBSInd;
def two_hoursBBSIndLo;
def two_hoursBBSIndHi;
def two_hoursSqueeze;
def two_hoursPreSqueeze;
def two_hoursExtraSqueeze;
def two_hoursMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.TWO_HOURS {
    two_hoursPrice = close(period = "2 Hours");
    two_hoursATR = Average(TrueRange(high (period = "2 Hours"), close(period = "2 Hours"), low(period = "2 Hours")), length);
    two_hoursSDev = StDev(two_hoursPrice, length);
    two_hoursDenom = (nk * two_hoursATR);
    two_hoursDenomLo = (nkLo * two_hoursATR);
    two_hoursDenomHi = (nkHi * two_hoursATR);
    two_hoursBBSInd = If (two_hoursDenom <> 0, ((nBB * two_hoursSDev) / two_hoursDenom), 0);
    two_hoursBBSIndLo = If (two_hoursDenomLo <> 0, ((nBB * two_hoursSDev) / two_hoursDenomLo), 0);
    two_hoursBBSIndHi = If (two_hoursDenomHi <> 0, ((nBB * two_hoursSDev) / two_hoursDenomHi), 0);
    two_hoursSqueeze = if two_hoursBBSInd < AlertLine then 1 else 0;
    two_hoursPreSqueeze = if two_hoursBBSIndHi < AlertLine then 1 else 0;
    two_hoursExtraSqueeze = if two_hoursBBSIndLo < AlertLine then 1 else 0;
    two_hoursMinAggregationPeriod = 1;
}
else {
    two_hoursPrice = 0;
    two_hoursATR = 0;
    two_hoursSDev = 0;
    two_hoursDenom = 0;
    two_hoursDenomLo = 0;
    two_hoursDenomHi = 0;
    two_hoursBBSInd = 0;
    two_hoursBBSIndLo = 0;
    two_hoursBBSIndHi = 0;
    two_hoursSqueeze = 0;
    two_hoursPreSqueeze = 0;
    two_hoursExtraSqueeze = 0;
    two_hoursMinAggregationPeriod = 0;
}
AddLabel(TwoHourLabel and two_hoursMinAggregationPeriod, "2h", if two_hoursPreSqueeze then GlobalColor("PreSqueeze") else if two_hoursSqueeze then GlobalColor("Squeeze" ) else if two_hoursExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("NO Squeeze"));

def hourPrice;
def hourATR;
def hourSDev;
def hourDenom;
def hourDenomLo;
def hourDenomHi;
def hourBBSInd;
def hourBBSIndLo;
def hourBBSIndHi;
def hourSqueeze;
def hourPreSqueeze;
def hourExtraSqueeze;
def HourMinAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.HOUR {
    hourPrice = close(period = "1 Hour");
    hourATR = Average(TrueRange(high (period = "1 Hour"), close(period = "1 Hour"), low(period = "1 Hour")), length);
    hourSDev = StDev(hourPrice, length);
    hourDenom = (nk * hourATR);
    hourDenomLo = (nkLo * hourATR);
    hourDenomHi = (nkHi * hourATR);
    hourBBSInd = If (hourDenom <> 0, ((nBB * hourSDev) / hourDenom), 0);
    hourBBSIndLo = If (hourDenomLo <> 0, ((nBB * hourSDev) / hourDenomLo), 0);
    hourBBSIndHi = If (hourDenomHi <> 0, ((nBB * hourSDev) / hourDenomHi), 0);
    hourSqueeze = if hourBBSInd < AlertLine then 1 else 0;
    hourPreSqueeze = if hourBBSIndHi < AlertLine then 1 else 0;
    hourExtraSqueeze = if hourBBSIndLo < AlertLine then 1 else 0;
    HourMinAggregationPeriod = 1;
}
else {
    hourPrice = 0;
    hourATR = 0;
    hourSDev = 0;
    hourDenom = 0;
    hourDenomLo = 0;
    hourDenomHi = 0;
    hourBBSInd = 0;
    hourBBSIndLo = 0;
    hourBBSIndHi = 0;
    hourSqueeze = 0;
    hourPreSqueeze = 0;
    hourExtraSqueeze = 0;
    HourMinAggregationPeriod = 0;
}
AddLabel(HourLabel and HourMinAggregationPeriod, "1h", if hourPreSqueeze then GlobalColor("PreSqueeze") else if hourSqueeze then GlobalColor("Squeeze" ) else if hourExtraSqueeze then GlobalColor("ExtraSqueeze") else GlobalColor("NO Squeeze"));

def Thirty_MinPrice;
def Thirty_MinATR;
def Thirty_MinSDev;
def Thirty_MinDenom;
def Thirty_MinDenomLo;
def Thirty_MinDenomHi;
def Thirty_MinBBSInd;
def Thirty_MinBBSIndLo;
def Thirty_MinBBSIndHi;
def Thirty_MinSqueeze;
def Thirty_MinPreSqueeze;
def Thirty_MinExtraSqueeze;
def Thirty_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THIRTY_MIN {
    Thirty_MinPrice = close(period = "30 Min");
    Thirty_MinATR = Average(TrueRange(high (period = "30 Min"), close(period = "30 Min"), low(period = "30 Min")), length);
    Thirty_MinSDev = StDev(Thirty_MinPrice, length);
    Thirty_MinDenom = (nk * Thirty_MinATR);
    Thirty_MinDenomLo = (nkLo * Thirty_MinATR);
    Thirty_MinDenomHi = (nkHi * Thirty_MinATR);
    Thirty_MinBBSInd = If (Thirty_MinDenom <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenom), 0);
    Thirty_MinBBSIndLo = If (Thirty_MinDenomLo <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenomLo), 0);
    Thirty_MinBBSIndHi = If (Thirty_MinDenomHi <> 0, ((nBB * Thirty_MinSDev) / Thirty_MinDenomHi), 0);
    Thirty_MinSqueeze = if Thirty_MinBBSInd < AlertLine then 1 else 0;
    Thirty_MinPreSqueeze = if Thirty_MinBBSIndHi < AlertLine then 1 else 0;
    Thirty_MinExtraSqueeze = if Thirty_MinBBSIndLo < AlertLine then 1 else 0;
    Thirty_MinAggregationPeriod = 1;
}
else {
    Thirty_MinPrice = 0;
    Thirty_MinATR = 0;
    Thirty_MinSDev = 0;
    Thirty_MinDenom = 0;
    Thirty_MinDenomLo = 0;
    Thirty_MinDenomHi = 0;
    Thirty_MinBBSInd = 0;
    Thirty_MinBBSIndLo = 0;
    Thirty_MinBBSIndHi = 0;
    Thirty_MinSqueeze = 0;
    Thirty_MinPreSqueeze = 0;
    Thirty_MinExtraSqueeze = 0;
    Thirty_MinAggregationPeriod = 0;
}
AddLabel(ThirtyMinLabel and Thirty_MinAggregationPeriod, "30m", if Thirty_MinSqueeze then GlobalColor("Squeeze") else if Thirty_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Thirty_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def Twenty_MinPrice;
def Twenty_MinATR;
def Twenty_MinSDev;
def Twenty_MinDenom;
def Twenty_MinDenomLo;
def Twenty_MinDenomHi;
def Twenty_MinBBSInd;
def Twenty_MinBBSIndLo;
def Twenty_MinBBSIndHi;
def Twenty_MinSqueeze;
def Twenty_MinPreSqueeze;
def Twenty_MinExtraSqueeze;
def Twenty_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWENTY_MIN {
    Twenty_MinPrice = close(period = "20 Min");
    Twenty_MinATR = Average(TrueRange(high (period = "20 Min"), close(period = "20 Min"), low(period = "20 Min")), length);
    Twenty_MinSDev = StDev(Twenty_MinPrice, length);
    Twenty_MinDenom = (nk * Twenty_MinATR);
    Twenty_MinDenomLo = (nkLo * Twenty_MinATR);
    Twenty_MinDenomHi = (nkHi * Twenty_MinATR);
    Twenty_MinBBSInd = If (Twenty_MinDenom <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenom), 0);
    Twenty_MinBBSIndLo = If (Twenty_MinDenomLo <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenomLo), 0);
    Twenty_MinBBSIndHi = If (Twenty_MinDenomHi <> 0, ((nBB * Twenty_MinSDev) / Twenty_MinDenomHi), 0);
    Twenty_MinSqueeze = if Twenty_MinBBSInd < AlertLine then 1 else 0;
    Twenty_MinPreSqueeze = if Twenty_MinBBSIndHi < AlertLine then 1 else 0;
    Twenty_MinExtraSqueeze = if Twenty_MinBBSIndLo < AlertLine then 1 else 0;
    Twenty_MinAggregationPeriod = 1;
}
else {
    Twenty_MinPrice = 0;
    Twenty_MinATR = 0;
    Twenty_MinSDev = 0;
    Twenty_MinDenom = 0;
    Twenty_MinDenomLo = 0;
    Twenty_MinDenomHi = 0;
    Twenty_MinBBSInd = 0;
    Twenty_MinBBSIndLo = 0;
    Twenty_MinBBSIndHi = 0;
    Twenty_MinSqueeze = 0;
    Twenty_MinPreSqueeze = 0;
    Twenty_MinExtraSqueeze = 0;
    Twenty_MinAggregationPeriod = 0;
}
AddLabel(TwentyMinLabel and Twenty_MinAggregationPeriod, "20m", if Twenty_MinSqueeze then GlobalColor("Squeeze") else if Twenty_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Twenty_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def Fifteen_MinPrice;
def Fifteen_MinATR;
def Fifteen_MinSDev;
def Fifteen_MinDenom;
def Fifteen_MinDenomLo;
def Fifteen_MinDenomHi;
def Fifteen_MinBBSInd;
def Fifteen_MinBBSIndLo;
def Fifteen_MinBBSIndHi;
def Fifteen_MinSqueeze;
def Fifteen_MinPreSqueeze;
def Fifteen_MinExtraSqueeze;
def Fifteen_MinAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN {
    Fifteen_MinPrice = close(period = "15 Min");
    Fifteen_MinATR = Average(TrueRange(high (period = "15 Min"), close(period = "15 Min"), low(period = "15 Min")), length);
    Fifteen_MinSDev = StDev(Fifteen_MinPrice, length);
    Fifteen_MinDenom = (nk * Fifteen_MinATR);
    Fifteen_MinDenomLo = (nkLo * Fifteen_MinATR);
    Fifteen_MinDenomHi = (nkHi * Fifteen_MinATR);
    Fifteen_MinBBSInd = If (Fifteen_MinDenom <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenom), 0);
    Fifteen_MinBBSIndLo = If (Fifteen_MinDenomLo <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenomLo), 0);
    Fifteen_MinBBSIndHi = If (Fifteen_MinDenomHi <> 0, ((nBB * Fifteen_MinSDev) / Fifteen_MinDenomHi), 0);
    Fifteen_MinSqueeze = if Fifteen_MinBBSInd < AlertLine then 1 else 0;
    Fifteen_MinPreSqueeze = if Fifteen_MinBBSIndHi < AlertLine then 1 else 0;
    Fifteen_MinExtraSqueeze = if Fifteen_MinBBSIndLo < AlertLine then 1 else 0;
    Fifteen_MinAggregationPeriod = 1;
}
else {
    Fifteen_MinPrice = 0;
    Fifteen_MinATR = 0;
    Fifteen_MinSDev = 0;
    Fifteen_MinDenom = 0;
    Fifteen_MinDenomLo = 0;
    Fifteen_MinDenomHi = 0;
    Fifteen_MinBBSInd = 0;
    Fifteen_MinBBSIndLo = 0;
    Fifteen_MinBBSIndHi = 0;
    Fifteen_MinSqueeze = 0;
    Fifteen_MinPreSqueeze = 0;
    Fifteen_MinExtraSqueeze = 0;
    Fifteen_MinAggregationPeriod = 0;
}
AddLabel(FifteenMinLabel and Fifteen_MinAggregationPeriod, "15m", if Fifteen_MinSqueeze then GlobalColor("Squeeze") else if Fifteen_MinExtraSqueeze then GlobalColor("ExtraSqueeze") else if Fifteen_MinPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));

def ten_minPrice;
def ten_minATR;
def ten_minSDev;
def ten_minDenom;
def ten_minDenomLo;
def ten_minDenomHi;
def ten_minBBSInd;
def ten_minBBSIndLo;
def ten_minBBSIndHi;
def ten_minSqueeze;
def ten_minPreSqueeze;
def ten_minExtraSqueeze;
def ten_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TEN_MIN {
    ten_minPrice = close(period = "10 Min");
    ten_minATR = Average(TrueRange(high (period = "10 Min"), close(period = "10 Min"), low(period = "10 Min")), length);
    ten_minSDev = StDev(ten_minPrice, length);
    ten_minDenom = (nk * ten_minATR);
    ten_minDenomLo = (nkLo * ten_minATR);
    ten_minDenomHi = (nkHi * ten_minATR);
    ten_minBBSInd = If (ten_minDenom <> 0, ((nBB * ten_minSDev) / ten_minDenom), 0);
    ten_minBBSIndLo = If (ten_minDenomLo <> 0, ((nBB * ten_minSDev) / ten_minDenomLo), 0);
    ten_minBBSIndHi = If (ten_minDenomHi <> 0, ((nBB * ten_minSDev) / ten_minDenomHi), 0);
    ten_minSqueeze = if ten_minBBSInd < AlertLine then 1 else 0;
    ten_minPreSqueeze = if ten_minBBSIndHi < AlertLine then 1 else 0;
    ten_minExtraSqueeze = if ten_minBBSIndLo < AlertLine then 1 else 0;
    ten_minAggregationPeriod = 1;
}
else {
    ten_minPrice = 0;
    ten_minATR = 0;
    ten_minSDev = 0;
    ten_minDenom = 0;
    ten_minDenomLo = 0;
    ten_minDenomHi = 0;
    ten_minBBSInd = 0;
    ten_minBBSIndLo = 0;
    ten_minBBSIndHi = 0;
    ten_minSqueeze = 0;
    ten_minPreSqueeze = 0;
    ten_minExtraSqueeze = 0;
    ten_minAggregationPeriod = 0;
}
AddLabel(TenMinLabel and ten_minAggregationPeriod, "10m", if ten_minSqueeze then GlobalColor("Squeeze") else if ten_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if ten_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def five_minPrice;
def five_minATR;
def five_minSDev;
def five_minDenom;
def five_minDenomLo;
def five_minDenomHi;
def five_minBBSInd;
def five_minBBSIndLo;
def five_minBBSIndHi;
def five_minSqueeze;
def five_minPreSqueeze;
def five_minExtraSqueeze;
def five_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN {
    five_minPrice = close(period = "5 Min");
    five_minATR = Average(TrueRange(high (period = "5 Min"), close(period = "5 Min"), low(period = "5 Min")), length);
    five_minSDev = StDev(five_minPrice, length);
    five_minDenom = (nk * five_minATR);
    five_minDenomLo = (nkLo * five_minATR);
    five_minDenomHi = (nkHi * five_minATR);
    five_minBBSInd = If (five_minDenom <> 0, ((nBB * five_minSDev) / five_minDenom), 0);
    five_minBBSIndLo = If (five_minDenomLo <> 0, ((nBB * five_minSDev) / five_minDenomLo), 0);
    five_minBBSIndHi = If (five_minDenomHi <> 0, ((nBB * five_minSDev) / five_minDenomHi), 0);
    five_minSqueeze = if five_minBBSInd < AlertLine then 1 else 0;
    five_minPreSqueeze = if five_minBBSIndHi < AlertLine then 1 else 0;
    five_minExtraSqueeze = if five_minBBSIndLo < AlertLine then 1 else 0;
    five_minAggregationPeriod = 1;
}
else {
    five_minPrice = 0;
    five_minATR = 0;
    five_minSDev = 0;
    five_minDenom = 0;
    five_minDenomLo = 0;
    five_minDenomHi = 0;
    five_minBBSInd = 0;
    five_minBBSIndLo = 0;
    five_minBBSIndHi = 0;
    five_minSqueeze = 0;
    five_minPreSqueeze = 0;
    five_minExtraSqueeze = 0;
    five_minAggregationPeriod = 0;
}
AddLabel(FiveMinLabel and five_minAggregationPeriod, "5m", if five_minSqueeze then GlobalColor("Squeeze") else if five_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if five_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def four_minPrice;
def four_minATR;
def four_minSDev;
def four_minDenom;
def four_minDenomLo;
def four_minDenomHi;
def four_minBBSInd;
def four_minBBSIndLo;
def four_minBBSIndHi;
def four_minSqueeze;
def four_minPreSqueeze;
def four_minExtraSqueeze;
def four_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.FOUR_MIN {
    four_minPrice = close(period = "4 Min");
    four_minATR = Average(TrueRange(high (period = "4 Min"), close(period = "4 Min"), low(period = "4 Min")), length);
    four_minSDev = StDev(four_minPrice, length);
    four_minDenom = (nk * four_minATR);
    four_minDenomLo = (nkLo * four_minATR);
    four_minDenomHi = (nkHi * four_minATR);
    four_minBBSInd = If (four_minDenom <> 0, ((nBB * four_minSDev) / four_minDenom), 0);
    four_minBBSIndLo = If (four_minDenomLo <> 0, ((nBB * four_minSDev) / four_minDenomLo), 0);
    four_minBBSIndHi = If (four_minDenomHi <> 0, ((nBB * four_minSDev) / four_minDenomHi), 0);
    four_minSqueeze = if four_minBBSInd < AlertLine then 1 else 0;
    four_minPreSqueeze = if four_minBBSIndHi < AlertLine then 1 else 0;
    four_minExtraSqueeze = if four_minBBSIndLo < AlertLine then 1 else 0;
    four_minAggregationPeriod = 1;
}
else {
    four_minPrice = 0;
    four_minATR = 0;
    four_minSDev = 0;
    four_minDenom = 0;
    four_minDenomLo = 0;
    four_minDenomHi = 0;
    four_minBBSInd = 0;
    four_minBBSIndLo = 0;
    four_minBBSIndHi = 0;
    four_minSqueeze = 0;
    four_minPreSqueeze = 0;
    four_minExtraSqueeze = 0;
    four_minAggregationPeriod = 0;
}
AddLabel(FourMinLabel and four_minAggregationPeriod, "4m", if four_minSqueeze then GlobalColor("Squeeze") else if four_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if four_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def three_minPrice;
def three_minATR;
def three_minSDev;
def three_minDenom;
def three_minDenomLo;
def three_minDenomHi;
def three_minBBSInd;
def three_minBBSIndLo;
def three_minBBSIndHi;
def three_minSqueeze;
def three_minPreSqueeze;
def three_minExtraSqueeze;
def three_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.THREE_MIN {
    three_minPrice = close(period = "3 Min");
    three_minATR = Average(TrueRange(high (period = "3 Min"), close(period = "3 Min"), low(period = "3 Min")), length);
    three_minSDev = StDev(three_minPrice, length);
    three_minDenom = (nk * three_minATR);
    three_minDenomLo = (nkLo * three_minATR);
    three_minDenomHi = (nkHi * three_minATR);
    three_minBBSInd = If (three_minDenom <> 0, ((nBB * three_minSDev) / three_minDenom), 0);
    three_minBBSIndLo = If (three_minDenomLo <> 0, ((nBB * three_minSDev) / three_minDenomLo), 0);
    three_minBBSIndHi = If (three_minDenomHi <> 0, ((nBB * three_minSDev) / three_minDenomHi), 0);
    three_minSqueeze = if three_minBBSInd < AlertLine then 1 else 0;
    three_minPreSqueeze = if three_minBBSIndHi < AlertLine then 1 else 0;
    three_minExtraSqueeze = if three_minBBSIndLo < AlertLine then 1 else 0;
    three_minAggregationPeriod = 1;
}
else {
    three_minPrice = 0;
    three_minATR = 0;
    three_minSDev = 0;
    three_minDenom = 0;
    three_minDenomLo = 0;
    three_minDenomHi = 0;
    three_minBBSInd = 0;
    three_minBBSIndLo = 0;
    three_minBBSIndHi = 0;
    three_minSqueeze = 0;
    three_minPreSqueeze = 0;
    three_minExtraSqueeze = 0;
    three_minAggregationPeriod = 0;
}
AddLabel(ThreeMinLabel and three_minAggregationPeriod, "3m", if three_minSqueeze then GlobalColor("Squeeze") else if three_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if three_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def two_minPrice;
def two_minATR;
def two_minSDev;
def two_minDenom;
def two_minDenomLo;
def two_minDenomHi;
def two_minBBSInd;
def two_minBBSIndLo;
def two_minBBSIndHi;
def two_minSqueeze;
def two_minPreSqueeze;
def two_minExtraSqueeze;
def two_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.TWO_MIN {
    two_minPrice = close(period = "2 Min");
    two_minATR = Average(TrueRange(high (period = "2 Min"), close(period = "2 Min"), low(period = "2 Min")), length);
    two_minSDev = StDev(two_minPrice, length);
    two_minDenom = (nk * two_minATR);
    two_minDenomLo = (nkLo * two_minATR);
    two_minDenomHi = (nkHi * two_minATR);
    two_minBBSInd = If (two_minDenom <> 0, ((nBB * two_minSDev) / two_minDenom), 0);
    two_minBBSIndLo = If (two_minDenomLo <> 0, ((nBB * two_minSDev) / two_minDenomLo), 0);
    two_minBBSIndHi = If (two_minDenomHi <> 0, ((nBB * two_minSDev) / two_minDenomHi), 0);
    two_minSqueeze = if two_minBBSInd < AlertLine then 1 else 0;
    two_minPreSqueeze = if two_minBBSIndHi < AlertLine then 1 else 0;
    two_minExtraSqueeze = if two_minBBSIndLo < AlertLine then 1 else 0;
    two_minAggregationPeriod = 1;
}
else {
    two_minPrice = 0;
    two_minATR = 0;
    two_minSDev = 0;
    two_minDenom = 0;
    two_minDenomLo = 0;
    two_minDenomHi = 0;
    two_minBBSInd = 0;
    two_minBBSIndLo = 0;
    two_minBBSIndHi = 0;
    two_minSqueeze = 0;
    two_minPreSqueeze = 0;
    two_minExtraSqueeze = 0;
    two_minAggregationPeriod = 0;
}
AddLabel(TwoMinLabel and two_minAggregationPeriod, "2m", if two_minSqueeze then GlobalColor("Squeeze") else if two_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if two_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));


def one_minPrice;
def one_minATR;
def one_minSDev;
def one_minDenom;
def one_minDenomLo;
def one_minDenomHi;
def one_minBBSInd;
def one_minBBSIndLo;
def one_minBBSIndHi;
def one_minSqueeze;
def one_minPreSqueeze;
def one_minExtraSqueeze;
def one_minAggregationPeriod;

if GetAggregationPeriod() <= AggregationPeriod.MIN {
    one_minPrice = close(period = "1 Min");
    one_minATR = Average(TrueRange(high (period = "1 Min"), close(period = "1 Min"), low(period = "1 Min")), length);
    one_minSDev = StDev(one_minPrice, length);
    one_minDenom = (nk * one_minATR);
    one_minDenomLo = (nkLo * one_minATR);
    one_minDenomHi = (nkHi * one_minATR);
    one_minBBSInd = If (one_minDenom <> 0, ((nBB * one_minSDev) / one_minDenom), 0);
    one_minBBSIndLo = If (one_minDenomLo <> 0, ((nBB * one_minSDev) / one_minDenomLo), 0);
    one_minBBSIndHi = If (one_minDenomHi <> 0, ((nBB * one_minSDev) / one_minDenomHi), 0);
    one_minSqueeze = if one_minBBSInd < AlertLine then 1 else 0;
    one_minPreSqueeze = if one_minBBSIndHi < AlertLine then 1 else 0;
    one_minExtraSqueeze = if one_minBBSIndLo < AlertLine then 1 else 0;
    one_minAggregationPeriod = 1;
}
else {
    one_minPrice = 0;
    one_minATR = 0;
    one_minSDev = 0;
    one_minDenom = 0;
    one_minDenomLo = 0;
    one_minDenomHi = 0;
    one_minBBSInd = 0;
    one_minBBSIndLo = 0;
    one_minBBSIndHi = 0;
    one_minSqueeze = 0;
    one_minPreSqueeze = 0;
    one_minExtraSqueeze = 0;
    one_minAggregationPeriod = 0;
}
AddLabel(OneMinLabel and one_minAggregationPeriod, "1m", if one_minSqueeze then GlobalColor("Squeeze") else if one_minExtraSqueeze then GlobalColor("ExtraSqueeze") else if one_minPreSqueeze then GlobalColor("PreSqueeze") else GlobalColor("No Squeeze"));
Hey Casey thanks so much for the code but how do I make one of the MTF histogram go underneath the MTF squeeze or vise versa? Mine are next to each other not underneath where they are aligned
 
Hey Casey thanks so much for the code but how do I make one of the MTF histogram go underneath the MTF squeeze or vise versa? Mine are next to each other not underneath where they are aligned
You just need to change the size of the chart. Make it smaller. There’s no other way to code the scripts so they align properly.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
382 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top