```
### MTF Squeeze Pro LABELS
##Global Variables
def length = 20;
def AlertLine = 1;
def nk1 = 1;
def nk2 = 1.5;
def nk3 = 2;
def nBB = 2;
def averageType = AverageType.SIMPLE;
def displace = 0;
def trueRangeAverageType = AverageType.SIMPLE;
########################################
## FIVE_MIN Aggregation Period Variables
########################################
def FIVE_MINPrice;
def FIVE_MINATR;
def FIVE_MINSDev;
def FIVE_MINDenom1;
def FIVE_MINDenom2;
def FIVE_MINDenom3;
def FIVE_MINBBSInd1;
def FIVE_MINBBSInd2;
def FIVE_MINBBSInd3;
def FIVE_MINPreSqueeze;
def FIVE_MINSqueeze;
def FIVE_MINExtraSqueeze;
def FIVE_MINAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.FIVE_MIN {
FIVE_MINPrice = close(period = "FIVE_MIN");
FIVE_MINATR = Average(TrueRange(high (period = "FIVE_MIN"), close(period = "FIVE_MIN"), low(period = "FIVE_MIN")), length);
FIVE_MINSDev = StDev(FIVE_MINPrice, length);
FIVE_MINDenom1 = (nk1 * FIVE_MINATR);
FIVE_MINDenom2 = (nk2 * FIVE_MINATR);
FIVE_MINDenom3 = (nk3 * FIVE_MINATR);
FIVE_MINBBSInd1 = If (FIVE_MINDenom1 <> 0, ((nBB * FIVE_MINSDev) / FIVE_MINDenom1), 0);
FIVE_MINBBSInd2 = If (FIVE_MINDenom2 <> 0, ((nBB * FIVE_MINSDev) / FIVE_MINDenom2), 0);
FIVE_MINBBSInd3 = If (FIVE_MINDenom3 <> 0, ((nBB * FIVE_MINSDev) / FIVE_MINDenom3), 0);
FIVE_MINPreSqueeze = if FIVE_MINBBSInd1 < AlertLine then 1 else 0;
FIVE_MINSqueeze = if FIVE_MINBBSInd2 < AlertLine then 1 else 0;
FIVE_MINExtraSqueeze = if FIVE_MINBBSInd3 < AlertLine then 1 else 0;
FIVE_MINAggregationPeriod = 1;
}
else {
FIVE_MINPrice = 0;
FIVE_MINATR = 0;
FIVE_MINSDev = 0;
FIVE_MINDenom1 = 0;
FIVE_MINDenom2 = 0;
FIVE_MINDenom3 = 0;
FIVE_MINBBSInd1 = 0;
FIVE_MINBBSInd2 = 0;
FIVE_MINBBSInd3 = 0;
FIVE_MINPreSqueeze = 0;
FIVE_MINSqueeze = 0;
FIVE_MINExtraSqueeze = 0;
FIVE_MINAggregationPeriod = 0;
}
AddLabel(yes, "5m", if FIVE_MINPreSqueeze then Color.BLACK else if FIVE_MINSqueeze then Color.RED else if FIVE_MINExtraSqueeze then Color.YELLOW else Color.DARK_GREEN);
########################################
## FOUR_MIN Aggregation Period Variables
########################################
def FOUR_MINPrice;
def FOUR_MINATR;
def FOUR_MINSDev;
def FOUR_MINDenom1;
def FOUR_MINDenom2;
def FOUR_MINDenom3;
def FOUR_MINBBSInd1;
def FOUR_MINBBSInd2;
def FOUR_MINBBSInd3;
def FOUR_MINPreSqueeze;
def FOUR_MINSqueeze;
def FOUR_MINExtraSqueeze;
def FOUR_MINAggregationPeriod;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_MIN {
FOUR_MINPrice = close(period = "FOUR_MIN");
FOUR_MINATR = Average(TrueRange(high (period = "FOUR_MIN"), close(period = "FOUR_MIN"), low(period = "FOUR_MIN")), length);
FOUR_MINSDev = StDev(FOUR_MINPrice, length);
FOUR_MINDenom1 = (nk1 * FOUR_MINATR);
FOUR_MINDenom2 = (nk2 * FOUR_MINATR);
FOUR_MINDenom3 = (nk3 * FOUR_MINATR);
FOUR_MINBBSInd1 = If (FOUR_MINDenom1 <> 0, ((nBB * FOUR_MINSDev) / FOUR_MINDenom1), 0);
FOUR_MINBBSInd2 = If (FOUR_MINDenom2 <> 0, ((nBB * FOUR_MINSDev) / FOUR_MINDenom2), 0);
FOUR_MINBBSInd3 = If (FOUR_MINDenom3 <> 0, ((nBB * FOUR_MINSDev) / FOUR_MINDenom3), 0);
FOUR_MINPreSqueeze = if FOUR_MINBBSInd1 < AlertLine then 1 else 0;
FOUR_MINSqueeze = if FOUR_MINBBSInd2 < AlertLine then 1 else 0;
FOUR_MINExtraSqueeze = if FOUR_MINBBSInd3 < AlertLine then 1 else 0;
FOUR_MINAggregationPeriod = 1;
}
else {
FOUR_MINPrice = 0;
FOUR_MINATR = 0;
FOUR_MINSDev = 0;
FOUR_MINDenom1 = 0;
FOUR_MINDenom2 = 0;
FOUR_MINDenom3 = 0;
FOUR_MINBBSInd1 = 0;
FOUR_MINBBSInd2 = 0;
FOUR_MINBBSInd3 = 0;
FOUR_MINPreSqueeze = 0;
FOUR_MINSqueeze = 0;
FOUR_MINExtraSqueeze = 0;
FOUR_MINAggregationPeriod = 0;
}
AddLabel(FOUR_MINPreSqueeze and Four_MinAggregationPeriod, "4m", color.black); AddLabel(FOUR_MINSqueeze and FOUR_MINAggregationPeriod, "4m", color.red); AddLabel(FOUR_MINExtraSqueeze and FOUR_MINAggregationPeriod, "4m", color.yellow);
AddLabel(Yes, "4m", color.dark_green);
```