NET CHANGE (NUMBERS, NO %)

N

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

mc01439

Active member
VIP
Warehouse
Not sure what you are asking for? Net change of what?
 
C

Craighaber71

Member
VIP
Warehouse
He wants net change instead of ATR...green background If positive and red negative...
 
mc01439

mc01439

Active member
VIP
Warehouse
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:

Top