#### markos

##### Well-known member

**VIP**

@ugaotrader Thanks for posting but this one is missing labels. We already have the original in Tutorials Section. The title is Multicolinearity.I call this "thermomixIndicator"

Code:`#Name: ChrisStoplight #Programmed By: Chris Ball (xxx) on #1/31/09 #Added Choppiness and Squeeze Indicator by [email protected] Lounge #Added FW_Mobo_Basic #Modified to add/change indicators declare lower; input showlabels = no; input showclouds = yes; input rsilength = 5; def c = close; def h = high; def l = low; def o = open; #MOMENTUM input lengthmo = 5; def Momentum = c - c[lengthmo]; plot mopos = if Momentum >= 0 then 3 else 2; mopos.SetDefaultColor(Color.GREEN); plot moneg = if Momentum < 0 then 3 else 2; moneg.SetDefaultColor(Color.RED); AddCloud(if showclouds then mopos else Double.NaN, if showclouds then moneg else Double.NaN, Color.GREEN); #CCI input lengthcci = 13; def pricecci = c + l + h; def linDev = LinDev(pricecci, lengthcci); def CCI = if linDev == 0 then 0 else (pricecci - Average(pricecci, lengthcci)) / linDev / 0.015; plot cci1 = if CCI >= 0 then 4 else 3; cci1.SetDefaultColor(Color.GREEN); plot cci2 = if CCI < 0 then 4 else 3; cci2.SetDefaultColor(Color.RED); AddCloud(if showclouds then cci1 else Double.NaN, if showclouds then cci2 else Double.NaN, Color.GREEN); #RSI def rsi = reference RSI(length = rsilength)."RSI"; plot rsi1 = if rsi >= 50 then 5 else 4; plot rsi2 = if rsi < 50 then 5 else 4; rsi1.SetDefaultColor(Color.GREEN); rsi2.SetDefaultColor(Color.RED); AddCloud(if showclouds then rsi1 else Double.NaN, if showclouds then rsi2 else Double.NaN, color1 = Color.GREEN); #Bollinger Bands MOBO input lengthmobo = 10; input Num_Dev_Dn = -0.8; input Num_Dev_up = 0.8; def sDev = StDev(data = c, length = lengthmobo); def Midmobo = Average(c, length = lengthmobo); def Lowermobo = Midmobo + Num_Dev_Dn * sDev; def Uppermobo = Midmobo + Num_Dev_up * sDev; def upmobo = if upmobo[1] == 0 and c >= Uppermobo then 1 else if upmobo[1] == 1 and c > Lowermobo then 1 else 0; def upmo = if upmobo and c > Uppermobo then 1 else 0; def dnmo = if !upmobo and c > Lowermobo then 1 else 0; plot mobo1 = if upmobo == 1 then 6 else 5; mobo1.SetDefaultColor(Color.GREEN); plot mobo2 = if upmobo == 0 then 6 else 5; mobo2.SetDefaultColor(Color.RED); AddCloud(if showclouds then mobo1 else Double.NaN, if showclouds then mobo2 else Double.NaN, Color.GREEN); #Trend #Choppiness Indicator from Mobius @My Trade with color changes by Lar #Set ADX & SMA to how you trade #Indicates Trending or Chop along with current ADX level def ADXLength = 5; #TOS default 10 input AverageType = AverageType.HULL; def AvgLength = 5; #TOS default 8 def Lengthchop = 8; def Signal = 3; def Choppy = 61.8; def MidLine = 50; def Trending = 38.2; def ADX = Round(reference ADX(length = ADXLength), 0); def AVG = MovingAverage(AverageType = AverageType, c, AvgLength); def CIB = ((Log(Sum(TrueRange(h, c, l), Lengthchop) / (Highest(if h >= c[1] then h else c[1], Lengthchop) - Lowest( if l <= c[1] then l else c[1], Lengthchop))) / Log(10)) / (Log(Lengthchop) / Log(10))) * 100; def CI = CIB; #Choppiness/Trend Indicator plot chop = if CI > MidLine then 7 else 6; chop.SetDefaultColor(Color.YELLOW); plot trend1 = if CI < MidLine and c > AVG then 7 else 6; trend1.SetDefaultColor(Color.GREEN); plot trend2 = if CI < MidLine and c < AVG then 7 else 6; trend2.SetDefaultColor(Color.RED); AddCloud(if showclouds then chop else Double.NaN, if showclouds then trend1 else Double.NaN, Color.YELLOW, Color.GREEN); AddCloud(if showclouds then chop else Double.NaN, if showclouds then trend2 else Double.NaN, Color.YELLOW, Color.RED); #Overall plot uptrend = if mopos == 3 and cci1 == 4 and rsi1 == 5 and mobo1 == 6 then 8 else 7; uptrend.SetDefaultColor(Color.GREEN); plot dntrend = if moneg == 3 and cci2 == 4 and rsi2 == 5 and mobo2 == 6 then 8 else 7; dntrend.SetDefaultColor(Color.RED); AddCloud(uptrend, dntrend, Color.GREEN, Color.RED); #Squeeze by Mobius @ My Trade with color mod by Lar #Look at Cloud Color as a possible indication of direction once squeeze ends def nK = 1.5; def nBB = 2.0; def lengthsqueeze = 20; def BBHalfWidth = StDev(c, lengthsqueeze); def KCHalfWidth = nK * Average(TrueRange(h, c, l), lengthsqueeze); def isSqueezed = nBB * BBHalfWidth / KCHalfWidth < 1; #Squeeze for Longer Term Trend Indicator plot BBS_Ind = if isSqueezed then 8.2 else Double.NaN; BBS_Ind.SetDefaultColor(Color.DARK_ORANGE); BBS_Ind.SetPaintingStrategy(PaintingStrategy.POINTS); BBS_Ind.SetLineWeight(2); BBS_Ind.HideBubble(); #Line Spacer plot line9 = 9; line9.SetDefaultColor(Color.DARK_GRAY); AddLabel(showlabels, "MOMENTUM " + Round(Momentum, 3), if Momentum >= 0 then Color.GREEN else Color.RED); AddLabel(showlabels, "CCI " + Round(CCI, 0), if CCI >= 0 then Color.GREEN else Color.RED); AddLabel(showlabels, "RSI " + Round(rsi, 0), if reference RSI(length = rsilength)."RSI" >= 50 then Color.GREEN else Color.RED); AddLabel(showlabels, if upmobo and upmo then "Mobo Above Upper" else if !upmo and dnmo then "Mobo Below Lower" else "Mobo Inside", if upmobo == 1 then Color.GREEN else Color.RED); AddLabel(showlabels, if CI > MidLine then "CHOP " + Round(CI, 0) else "TRENDING " + Round(CI, 0), if CI > MidLine then Color.YELLOW else Color.WHITE); AddLabel(showlabels, "ADX " + ADX, if CI > MidLine then Color.YELLOW else Color.WHITE); AddLabel(showlabels, if uptrend == 8 then "Trend All Up " else if dntrend == 8 then "Trend All Down " else "Trend Mixed ", if uptrend == 8 then Color.GREEN else if dntrend == 8 then Color.RED else Color.GRAY); #Count of Periods in consecutive squeeze #rec count = if isSqueezed then count[1] + 1 else 0; #AddLabel(yes, if isSqueezed then Concat("Squeeze ", count) else "No Squeeze", Color.DARK_ORANGE);`

Last edited: