NET CHANGE (NUMBERS, NO %)

ntobiasagustin

New member
I need help. I want the net chage to appear at the top left as the ATR. If it is positive that it turns green and if it is negative that it turns red. Here is a capture of what the ATR looks like and the study code.


Please help me, i can't do that. Thanks!!
 

mc01439

Well-known member
2019 Donor
VIP
declare upper;
input price = close;
input ATRLength = 5;
input Show_Labels = yes;

def ATR = Average(TrueRange(high, close, low), ATRLength);

#Label
def ATRNC = ATR -ATR[1];
def U = ATR > ATR[1];
def d = ATR < ATR[1];
AddLabel(Show_Labels, Concat("ATR @ ", ATR), Color.GRAY);
addlabel(Show_Labels , concat("ATR Net Change = ",ATRNC), if U then color.green else if d then color.red else Color.yellow);
 
Last edited:

Similar threads

Top