#Combo ST and CCI ATR TREND Coloumn def c = close; def h = high; def l = low; def pricedata = hl2; input show_inside_bar_count = Yes; #SUPERTREND input ST_Atr_Mult = 1.3; input ST_Length = 60; input ST_AvgType = AverageType.wilders; def ATR = MovingAverage(ST_AvgType, TrueRange(high, close, low), ST_Length); def UP = HL2 + (ST_Atr_Mult* ATR); def DN = HL2 + (-ST_Atr_Mult * ATR); def ST = if close < ST[1] then UP else DN; def SuperTrend = ST; #CCI_ATR input lengthCCI = 50; input lengthATR = 5; input AtrFactor = 1.0; def ATRcci = Average(TrueRange(h, c, l), lengthATR) * AtrFactor; def price = c + l + h; def linDev = LinDev(price, lengthCCI); def CCI = if linDev == 0 then 0 else (price - Average(price, lengthCCI)) / linDev / 0.015; def MT1 = if CCI > 0 then Max(MT1[1], pricedata - ATRcci) else Min(MT1[1], pricedata + ATRcci); def CCI_ATR_TREND = MT1; #plot ST_ATR_COMBO = if C> ST and C>CCI_ATR_TREND then 4 else if c< ST and c ma; #def crossBelow = close[1] > ma[1] and close < ma; def COMBOUP = C> ST and C>CCI_ATR_TREND; def COMBODN = C< ST and C AbsValue(countBelow) then countAbove else countBelow; data.AssignValueColor(if data == 0 then Color.CURRENT else Color.BLACK); AssignBackgroundColor(if data > 0 then Color.GREEN else if data < 0 then Color.RED else Color.CURRENT);