```
def c = close;
def h = high;
def l = low;
def pricedata = hl2;
#SUPERTREND
input tradesize = 2;
input ST_Atr_Mult = 1.0;
input ST_Length = 4;
input ST_AvgType = AverageType.HULL;
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 = 21;
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 Min(CCI_ATR_TREND, ST) else if c < ST and c < CCI_ATR_TREND then Max(CCI_ATR_TREND, ST) else CCI_ATR_TREND;
ST_ATR_COMBO.AssignValueColor(if c < MT1 and c < ST then Color.MAGENTA else if c > MT1 and c > ST then Color.CYAN else Color.LIGHT_GRAY);
ST_ATR_COMBO.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
```