SuperTrend CCI ATR Trend for ThinkorSwim

HI ! Do you have this indicator without the color on the candle ?Thank you in advance

The easiest way to prevent this indicator from painting the candles would be to take out the AssignPriceColor statement.
In this case, it would be deleting this code from the bottom of the script:
Ruby:
# Candle Colors

AssignPriceColor(if Pos_State then Color.GREEN
                 else if Neg_State then Color.RED
                 else Color.YELLOW);

If you want to preserve the option of painting the candles, you can replace the above code with:
Ruby:
# Candle Colors
input PaintCandles = no ;
AssignPriceColor(if !PaintCandles then color.current else
                         if Pos_State then Color.GREEN
                 else if Neg_State then Color.RED
                 else Color.YELLOW);
 

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

I add showtodayonly, today and aftermarket. It works very well for one day display but one thing bother my eyes that the tail vertical at 0900 am displays so long to straight down , can you able fix its tail short for me? Thanks


input agg = AggregationPeriod.FIFTEEN_MIN;
def c = close(period = agg);
def h = high(period = agg);
def l = low(period = agg);
def pricedata = hl2(period = agg);

input ShowTodayOnly={"No", default "Yes"};
def Today = if GetLastDay() == GetDay() then 1 else 0;

input afterbegin = 0900;
input afterend = 1600;

def aftermarket = SecondsFromTime(afterbegin) >= 0 and SecondsTillTime(afterend) >= 0;


DefineGlobalColor("TrendUp", CreateColor(0, 254, 30));
DefineGlobalColor("TrendDown", CreateColor(255, 3, 2));


input lengthCCI = 50;
input lengthATR = 5;
input AtrFactor = 0.7;

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 and showtodayonly and today and aftermarket then Max(MT1[1], pricedata - ATRcci)
else Min(MT1[1], pricedata + ATRcci);
plot data = MT1;
data.AssignValueColor(if c < MT1 then Color.RED else Color.GREEN);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
220 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