JJJJJJ11111
Member
I'm trying to get the label where,
if price is above 200sma , it will label as "Above200MA" in green
if price is below 200sma, it will label as "below200MA" in red
If the price is rising 200sma it will label as "rising200ma" in green
If the price is not rising 200sma it will label as "NA" in red
thanks in advanced
if price is above 200sma , it will label as "Above200MA" in green
if price is below 200sma, it will label as "below200MA" in red
If the price is rising 200sma it will label as "rising200ma" in green
If the price is not rising 200sma it will label as "NA" in red
thanks in advanced
Code:
input price = close;
input length = 200;
input displace = 0;
def SMA = Average(price[-displace], length);
def above200ma = close>sma;
def rising200ma = sma>sma[3];
AddLabel(yes, " " + above200ma, Color.Green);
AddLabel(yes, " " + rising200ma, Color.Green);