• LIMITED TIME ONLY: Take $40 off VIP with code: BTD40.

Help with Custom Column

andreythedon

New member
VIP
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);

andreythedon

New member
VIP
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.
 

halcyonguy

Well-known member
VIP
Lifetime
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

andreythedon

New member
VIP
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
 

Similar threads

Top