Supertrend CCI ATR in 1 Plot For Mobile For ThinkOrSwim

leakywaders

New member
Hi to all!!!

A boring day watching SPY burn theta so thought I'd jump on here and contribute back. This chart indicator is a combination of two indicators found here and elsewhere but combined into a single plot - the CCI ATR Trend indicator and Supertrend. It plots a connected dotted line based on the lowest value of the two indicators if it's in an uptrend or the highest of the two if it's in a downtrend - the dots color if both indicators are in agreement or the dots are grey if they are not. All credit goes to the original creators - I just combined the two to make sure they are in agreement and to simplify my chart setup. I don't post here much but hope you can find some use out of this. It's made me quite a bit of money - both the standalone indicators and now it's combination. I've customized the inputs to match what I've found to work best but they can be changed either in the script or in the settings to whatever you like. Works on mobile.

Works very well on the 1 minute - 5 minute charts. Nice clean lines on TOS mobile. Great for finding early reversals and to keep you in a choppy yet trending trade.
Indicator
https://tos.mx/T0U5Ty
Watchlist Column (EDIT: doesn't work right on mobile)- Just save multiple instances of this and change the aggregation period to get an at a glance MTF analysis of the indicator over your whole watchlist. Colored if in agreement - grey if not. EDIT: SORRY on mobile this doesn't produce accurate results. It works on a PC though. I just compared it. Thought it did but it doesn't maybe someone can tweak it or I'll spend time on it and share another version. I'm done trading for the day though so It'll be a PC version for now:)
https://tos.mx/L5pVNN
Got to go looks like SPY is moving. I probably won't be able to comment much more on this. Please feel free to edit and tweak to your liking:)
Ruby:
# SUPERTREND BY MOBIUS AND CCI ATR TREND COMBINED INTO ONE CHART INDICATOR, BOTH IN AGREEMENT IS A VERY POWERFUL SIGNAL IF TRENDING. VERY GOOD AT CATCHING REVERSALS. WORKS WELL ON 1 AND 5 MIN CHARTS. PLOT IS THE COMBINATION LOWEST FOR UPTREND AND HIGHEST OF THE DOWNTREND. DOTS COLORED IF BOTH IN AGREEMENT OR GREY IF NOT -  08/10/19 DTEK


def c = close;
def h = high;
def l = low;
def pricedata = hl2;

#SUPERTREND
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);
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Nice! Just my style. I love ATR/supertrends and adding CCI is neat. I'm actually not well-versed on CCI so off to the interwebs for me.
 
Having a little problem. On smaller timeframes, it does this and scrunches up the price action.
 
Last edited by a moderator:
I love this indicator... removed the lines and just color coded the price candles.
Code:
# SUPERTREND BY MOBIUS AND CCI ATR TREND COMBINED INTO ONE CHART INDICATOR, BOTH IN AGREEMENT IS A VERY POWERFUL SIGNAL IF TRENDING. VERY GOOD AT CATCHING REVERSALS. WORKS WELL ON 1 AND 5 MIN CHARTS. PLOT IS THE COMBINATION LOWEST FOR UPTREND AND HIGHEST OF THE DOWNTREND. DOTS COLORED IF BOTH IN AGREEMENT OR GREY IF NOT -  08/10/19 DTEK


def c = close;
def h = high;
def l = low;
def pricedata = hl2;

#SUPERTREND
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;

AssignPriceColor(if c < MT1 and c <ST then color.LIGHT_RED else if C > MT1 and c >ST then color.GREEN else color.YELLOW);
 
Last edited:
@Miket It is a combination of two trend indicators. So it is supposed to give a good trend signal. If the two trend indicators are in agreement on the direction of the trend it plots a green dot for an uptrend, red dot for downtrend. If they are not in agreement it plots the gray dot. So basically green buy, red sell. Gray wait or hold for a green or red dot.
 
Could I trouble someone to please post the script for the watchlist column? My platform will not allow the import of these but I can install from script. Thank you
 
Could I trouble someone to please post the script for the watchlist column? My platform will not allow the import of these but I can install from script. Thank you

Code:
#Combo ST and CCI ATR TREND Coloumn



def c = close;

def h = high;

def l = low;

def pricedata = hl2;





#SUPERTREND

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 4 else if c< ST and c<CCI_ATR_TREND then -4 else 0;



AssignBackgroundColor(if ST_ATR_COMBO ==4 then color.cyaN else if ST_ATR_COMBO == -4 then color.magENTA else color.DARK_GRAY);

ST_ATR_COMBO.assignValueColor(color.blue);
 
@Miket It is a combination of two trend indicators. So it is supposed to give a good trend signal. If the two trend indicators are in agreement on the direction of the trend it plots a green dot for an uptrend, red dot for downtrend. If they are not in agreement it plots the gray dot. So basically green buy, red sell. Gray wait or hold for a green or red dot.
Thank you.

I tend to overthink things.
 
I love this indicator... removed the lines and just color coded the price candles.
Code:
# SUPERTREND BY MOBIUS AND CCI ATR TREND COMBINED INTO ONE CHART INDICATOR, BOTH IN AGREEMENT IS A VERY POWERFUL SIGNAL IF TRENDING. VERY GOOD AT CATCHING REVERSALS. WORKS WELL ON 1 AND 5 MIN CHARTS. PLOT IS THE COMBINATION LOWEST FOR UPTREND AND HIGHEST OF THE DOWNTREND. DOTS COLORED IF BOTH IN AGREEMENT OR GREY IF NOT -  08/10/19 DTEK


def c = close;
def h = high;
def l = low;
def pricedata = hl2;

#SUPERTREND
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;

AssignPriceColor(if c < MT1 and c <ST then color.LIGHT_RED else if C > MT1 and c >ST then color.GREEN else color.YELLOW);
@Wormtrader do yourself a favor. Don't delete lines. If instead of you "comment then out" by putting a # in front of each unwanted line they will be inactive but always available.
 
Can someone please help me with the watchlist column. I got the script but it doesn't show as an available column in the watchlist. I must be doing something wrong. Thank you.
 
Thank you for your reply. I used the shared link but when I clicked the "View in thinkorswim" nothing opened so I copied the above script from Miket and did a create under studies. I just now did the shared link manually and now I have it. Not sure why the view in thinkorswim didn't work or why the create study didn't work but I'm not real familiar with tos.
 
Now that I got the column loaded it shows 4.0 and -4.0 for any time frame trend regardless of how many red or blue dots there are. Do I need to change something to get the actual number? Thanks.
 
Pretty neat. I thought there was an agreement that the Super works best on 3. :cool:
Ooooh, use this one with the Reversal on the 5. Very nice!
 
Last edited:
Newbie here...pretty impressive results back testing this with futures. Is anyone using this strategy for real? Am I missing something?
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
475 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top