ADX Trend label for ThinkorSwim

Just updated the code with params that work for my style. You can play around with the input to work best for you. Good luck! @cabe1332
ADX has worked well with me and made $ today. Trend is my friend and ADX sure allows you to ride them longer. Sharing a watchlist column that may help you with your trading. Enjoy and let me know how it works for you. Good luck! @cabe1332

# ADX Dynamic Watchlist Column
# cabe1332

# code start
input ADXLength = 6;
input ADXLower = 25;
input ADXMid = 40;
input ADXHigh = 75;
#input MALength = 10;
input MALength = 9;

def ADXlabel = reference ADX(ADXLength).ADX;
def MA = reference movAvgExponential(close,MALength);

plot data = round(ADXlabel,1);
data.assignValueColor(if data >= 20 then color.blue else color.red);

AssignBackgroundColor(
if ADXlabel < ADXLower then Color.CYAN else
if ADXlabel < ADXMid then Color.RED else
if (ADXlabel < ADXlabel[1]) then Color.YELLOW else
if ADXlabel > ADXlabel[1] and MA > MA[1] and ADXlabel < ADXHigh then Color.GREEN else
if ADXlabel > ADXlabel[1] and MA < MA[1] then Color.RED else
if ADXlabel > ADXHigh then Color.MAGENTA else Color.light_gray);

# code end
 
Last edited by a moderator:

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

ADX has worked well with me and made $ today. Trend is my friend and ADX sure allows you to ride them longer. Sharing a watchlist column that may help you with your trading. Enjoy and let me know how it works for you. Good luck! @cabe1332

# ADX Dynamic Watchlist Column
# cabe1332

# code start
input ADXLength = 6;
input ADXLower = 25;
input ADXMid = 40;
input ADXHigh = 75;
#input MALength = 10;
input MALength = 9;

def ADXlabel = reference ADX(ADXLength).ADX;
def MA = reference movAvgExponential(close,MALength);

plot data = round(ADXlabel,1);
data.assignValueColor(if data >= 20 then color.blue else color.red);

AssignBackgroundColor(if ADXlabel < ADXLower then Color.CYAN else if ADXlabel < ADXMid then Color.RED else if (ADXlabel < ADXlabel[1]) then Color.YELLOW else if ADXlabel > ADXlabel[1] and MA > MA[1] and ADXlabel < ADXHigh then Color.GREEN else if ADXlabel > ADXlabel[1] and MA < MA[1] then Color.RED else if ADXlabel > ADXHigh then Color.MAGENTA else Color.light_gray);

# code end

T4iq51G.png
Hi cabe1332, can you share a copy of the SQZFired?
 
Hi cabe1332, can you share a copy of the SQZFired?
@mbarcala here you go. I also have it as a column or combination with an existing columns as a background. You add sound alerts if you want. Works on all timeframe.

Good luck and good trading! @cabe1332

#This will fire an alert when a stock is about to release pressure
#from squeeze. Dot change from Red to Green or Orange or Yellow or Black
#Momentum explodes afterward.
#cabe1332

def S = reference TTM_Squeeze().SqueezeAlert;
def H = reference TTM_Squeeze().Histogram;

plot Arrow = !S[1] and S and H > 0 and H > H[1];
Arrow.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);
Arrow.SetLineWeight(2);
Arrow.SetDefaultColor(color.yellow);
 
Last edited by a moderator:
@mbarcala here you go. I also have it as a column or combination with an existing columns as a background. You add sound alerts if you want. Works on all timeframe.

Good luck and good trading! @cabe1332

#This will fire an alert when a stock is about to release pressure
#from squeeze. Dot change from Red to Green or Orange or Yellow or Black
#Momentum explodes afterward.
#cabe1332

def S = reference TTM_Squeeze().SqueezeAlert;
def H = reference TTM_Squeeze().Histogram;

plot Arrow = !S[1] and S and H > 0 and H > H[1];
Arrow.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);
Arrow.SetLineWeight(2);
Arrow.SetDefaultColor(color.yellow);
how do you write the code for squeeze pressure increasing? Thanks
 
Hello All, I am allowed to make this post very much because of the members here. I studied many of the posts dealing with labels. My immense gratitude to anyone that used labels in their scripts. A special shout-out to @markos for his RGB color labels. I referred to that over a dozen times when working on the various labels that I created for my studies. My system is quite simple. As I hinted to in other posts, I trade NQs. My first step, as many do, is to review the daily chart for an overview. I then rely on the 15 minute charts for the general trend. Then the 5 minute chart for the setup. Finally the 1 minute for the trigger. The 5 minute is really the most important chart I use, and this label script is used on there and the settings reflect how I use it. I have found that most powerful trends begin with the ADX (5) on the 5 minutes chart below 25. Also, many trends reverse with it over 70. I use the Hull MA in combination to identify a trend. I hope that you can use it or modify it for your own purposes.

Code:
##### Begin Code #####

# SD_ADXLabel
# Scott XXX
# Version: 01
# Original: November 17, 2020
# Last Mod: November 18, 2020

declare upper;

input ADXLength = 5;
input ADXLower = 25;
input ADXMid = 40;
input ADXHigh = 70;
input MALength = 10;

def ADXlabel = reference ADX(ADXLength).ADX;
def MA = reference HullMovingAvg(close,MALength);

AddLabel(yes, "                     ADX SETTING UP                     ", if ADXlabel < ADXLower then Color.CYAN else Color.BLACK);

AddLabel(yes, " ADX WATCH ", if ADXlabel < ADXMid then Color.WHITE else Color.BLACK);

AddLabel(yes, " ADX TREND WEAKENING ", if (ADXlabel < ADXlabel[1]) then Color.YELLOW else Color.BLACK);

AddLabel(yes, "           UP TREND           ", if ADXlabel > ADXlabel[1] and MA > MA[1] then Color.GREEN else Color.BLACK);

AddLabel(yes, "           DOWN TREND           ", if ADXlabel > ADXlabel[1] and MA < MA[1] then Color.RED else Color.BLACK);

AddLabel(yes, " ADX HIGH ", if ADXlabel > ADXHigh then Color.MAGENTA else Color.BLACK);

##### End Code #####
Could you elaborate on your system?
 
Could you elaborate on your system?
Here is what the @scott69 said:
  1. My first step, as many do, is to review the daily chart for an overview.
  2. I then rely on the 15 minute charts for the general trend.
  3. Look to the enclosed script on the 5 minute chart for the setup.
  4. Finally the 1 minute for the trigger.
The 5 minute is really the most important chart I use, and this label script is used on there and the settings reflect how I use it.

I have found that most powerful trends begin with the ADX (5) on the 5 minutes chart below 25.

Also, many trends reverse with it over 70. I use the Hull MA in combination to identify a trend. I hope that you can use it or modify it for your own purposes.
 
ADX has worked well with me and made $ today. Trend is my friend and ADX sure allows you to ride them longer. Sharing a watchlist column that may help you with your trading. Enjoy and let me know how it works for you. Good luck! @cabe1332

# ADX Dynamic Watchlist Column
# cabe1332

# code start
input ADXLength = 6;
input ADXLower = 25;
input ADXMid = 40;
input ADXHigh = 75;
#input MALength = 10;
input MALength = 9;

def ADXlabel = reference ADX(ADXLength).ADX;
def MA = reference movAvgExponential(close,MALength);

plot data = round(ADXlabel,1);
data.assignValueColor(if data >= 20 then color.blue else color.red);

AssignBackgroundColor(if ADXlabel < ADXLower then Color.CYAN else if ADXlabel < ADXMid then Color.RED else if (ADXlabel < ADXlabel[1]) then Color.YELLOW else if ADXlabel > ADXlabel[1] and MA > MA[1] and ADXlabel < ADXHigh then Color.GREEN else if ADXlabel > ADXlabel[1] and MA < MA[1] then Color.RED else if ADXlabel > ADXHigh then Color.MAGENTA else Color.light_gray);

# code end
Hi, Can you please explain the colors please?
 
Hi, Can you please explain the colors please?
Your question is:
How to read this portion of the script
AssignBackgroundColor(
if ADXlabel < ADXLower then Color.CYAN else
if ADXlabel < ADXMid then Color.RED else
if (ADXlabel < ADXlabel[1]) then Color.YELLOW else
if ADXlabel > ADXlabel[1] and MA > MA[1] and ADXlabel < ADXHigh then Color.GREEN else
if ADXlabel > ADXlabel[1] and MA < MA[1] then Color.RED else
if ADXlabel > ADXHigh then Color.MAGENTA else Color.light_gray);

Translation:
if ADX is less than the threshold of 25 Color =CYAN else
if ADX>25 and <40 Color=RED else
if ADX is neither of the above and ADX trending downwards Color=YELLOW
if ADX is none of the above
and ADX trending upwards
and EMA9 trending upwards
and ADX is less than the ceiling of 75 Color =GREEN else
if ADX is downtrending and EMA9 is downtrending Color =RED
if ADX is greater than the ceiling of 75 Color =MAGENTA else Color =light_gray

The question as to why we use these thresholds and ceilings is beyond the scope of this thread.
Anyone considering using the ADX on their charts would be advised to research the pros and cons of the ADX.
It is the definitive trend direction indicator, but it is not without its weaknesses.
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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