Help with Custom Column

andreythedon

New member
This script should add the text ATRX when the defined criteria (ATR average crosses above ATR). The column works. When the criteria is met the Text shows up. However when not met. It shows "LOADING".

How might I get rid of the "LOADING"? I've tried using if/then/else for the TEXT section of addlabel, also tried it for the VISIBLE section. Any other ideas?

Much Appreciated!!
def atrplot = Average(data = ATR(), length = 14);
def crossx= Crosses(data1 = atrplot, data2 = atr(), direction = CrossingDirection.ABOVE) within 5 bars;

AddLabel(visible = crossx, "ATRX", color = Color.DARK_RED);
AssignBackgroundColor(parameter0 = if crossx then color.lighT_RED else color.white );
 
Solution
This script should add the text ATRX when the defined criteria (ATR average crosses above ATR). The column works. When the criteria is met the Text shows up. However when not met. It shows "LOADING".

How might I get rid of the "LOADING"? I've tried using if/then/else for the TEXT section of addlabel, also tried it for the VISIBLE section. Any other ideas?

Much Appreciated!!
maybe this will work

AddLabel(1, ( if crossx then "ATRX"
else "--" ), Color.DARK_RED);
This script should add the text ATRX when the defined criteria (ATR average crosses above ATR). The column works. When the criteria is met the Text shows up. However when not met. It shows "LOADING".

How might I get rid of the "LOADING"? I've tried using if/then/else for the TEXT section of addlabel, also tried it for the VISIBLE section. Any other ideas?

Much Appreciated!!
maybe this will work

AddLabel(1, ( if crossx then "ATRX"
else "--" ), Color.DARK_RED);
 
Solution
I managed to find a post that said that weekends can cause unusual results. I will revisit this post during the weekday if the problem persists...for the time being we will call this solved. Feel free to use the Column if you find it beneficial...I also made a lower level indicator.
 
maybe this will work

AddLabel(1, ( if crossx then "ATRX"
else "--" ), Color.DARK_RED);
Mannnn... Genius!! Thanks

I played with your script a bit then my old scripts. Turns out I was trying to use if/then statements in the VISIBLE section. I should have left that alone and only used it in the TEXT section.

Again....you've made hours of trials worth the effort.

Thanks @halcyonguy
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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