Commodity Channel Index (CCI) With Supertrend

CCI indicator oscillates between an overbought and oversold condition and works best in a sideways market.

BUY{
SET C1 = CCI(21,SIMPLE);
SET ST = SUPERTREND(21,2,SIMPLE);
CLOSE > ST AND C1 > 0.01 AND REF(C1,1) < 0.01;}

LONGEXIT{
SET C1 = CCI(21,SIMPLE);
SET ST = SUPERTREND(21,2,SIMPLE);
CLOSE < ST;}

SELL{
SET C1 = CCI(21,SIMPLE);
SET ST = SUPERTREND(21,2,SIMPLE);
CLOSE < ST AND C1 < 0.01 AND REF(C1,1) > 0.01;}

SHORTEXIT{
SET C1 = CCI(21,SIMPLE);
SET ST = SUPERTREND(21,2,SIMPLE);
CLOSE > ST;}

This slideshow requires JavaScript.